diff mbox series

[alsa-lib] ucm: Fix sysw sequence command not working when requesting to ignore errors

Message ID 20210503205244.167473-1-hdegoede@redhat.com
State New
Headers show
Series [alsa-lib] ucm: Fix sysw sequence command not working when requesting to ignore errors | expand

Commit Message

Hans de Goede May 3, 2021, 8:52 p.m. UTC
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(-)

Comments

Jaroslav Kysela May 4, 2021, 8:38 a.m. UTC | #1
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
diff mbox series

Patch

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;