All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-lib] ucm: Fix sysw sequence command not working when requesting to ignore errors
@ 2021-05-03 20:52 Hans de Goede
  2021-05-04  8:38 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2021-05-03 20:52 UTC (permalink / raw)
  To: Jaroslav Kysela, alsa-devel; +Cc: Hans de Goede

When the user requests to ignore sysfs write errors by prefixing
the path with a '-' then we need to skip the '-' when building the
actual path otherwise the write will never work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/ucm/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/ucm/main.c b/src/ucm/main.c
index 2b07cc95..3df9b62a 100644
--- a/src/ucm/main.c
+++ b/src/ucm/main.c
@@ -517,7 +517,10 @@ static int execute_sysw(const char *sysw)
 	if (sysw == NULL || *sysw == '\0')
 		return 0;
 
-	ignore_error = sysw[0] == '-';
+	if (sysw[0] == '-') {
+		ignore_error = true;
+		sysw++;
+	}
 
 	if (sysw[0] == ':')
 		return -EINVAL;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH alsa-lib] ucm: Fix sysw sequence command not working when requesting to ignore errors
  2021-05-03 20:52 [PATCH alsa-lib] ucm: Fix sysw sequence command not working when requesting to ignore errors Hans de Goede
@ 2021-05-04  8:38 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2021-05-04  8:38 UTC (permalink / raw)
  To: Hans de Goede, alsa-devel

Dne 03. 05. 21 v 22:52 Hans de Goede napsal(a):
> When the user requests to ignore sysfs write errors by prefixing
> the path with a '-' then we need to skip the '-' when building the
> actual path otherwise the write will never work.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Thank you. Applied.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-04  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 20:52 [PATCH alsa-lib] ucm: Fix sysw sequence command not working when requesting to ignore errors Hans de Goede
2021-05-04  8:38 ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.