Skip to contentSkip to conversation

ucm: Fix sysw sequence command not working when requesting to ignore errors

PATCH In review Hans de Goede 2 participants 2 messages May 3, 2021 – May 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ucm: Fix sysw sequence command not working when requesting to ignore errors

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.

---
 src/ucm/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/ucm/main.c +4 -1
index 2b07cc95..3df9b62a 100644
@@ -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;
Signature · 1 line
2.31.1
#1 lore raw

Dne 03. 05. 21 v 22:52 Hans de Goede napsal(a):

Quoted 5 lines

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.

Thank you. Applied.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.