mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
chreipl: make write_str_errno return errno as the name suggests
Make write_str_errno return errno in all error cases, so that it would
be usable in scenarious where open call could fail and we just want to
get an errno, not to exit.
This function is currently only used by chshut in a context where
such a change wouldn't hurt debug ability.
159 if (write_str_errno(argv[2], path))
160 ERR_EXIT_ERRNO("Could not set \"%s\"", path);
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
4b33d80595
commit
262a827ab4
@@ -129,7 +129,7 @@ int write_str_errno(char *string, char *file)
|
||||
snprintf(path, sizeof(path), "/sys/firmware/%s", file);
|
||||
fh = open(path, O_WRONLY);
|
||||
if (fh < 0)
|
||||
ERR_EXIT_ERRNO("Could not open \"%s\"", file);
|
||||
return errno;
|
||||
if (write(fh, value, strlen(value)) < 0)
|
||||
return errno;
|
||||
close(fh);
|
||||
|
||||
Reference in New Issue
Block a user