Skip to contentSkip to conversation

master - scripts: avoid voiding write result

PATCH Zdenek Kabelac 1 participant 1 message Dec 21, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a4577c427a76c6a337b7812f9da7700c2c8beb89
Commit:        a4577c427a76c6a337b7812f9da7700c2c8beb89
Parent:        a3fe6195521a58c93d7158028c7ab62da14d4ddd
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Dec 21 11:19:25 2018 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Dec 21 21:42:30 2018 +0100

scripts: avoid voiding write result

Gcc doesn't want to ignore write() return code.

---
 .../lvm2_activation_generator_systemd_red_hat.c    |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
scripts/lvm2_activation_generator_systemd_red_hat.c +2 -1
index 0e6c05a..b44c8f0 100644
@@ -69,7 +69,8 @@ static void _error(const char *format, ...)
 		return;
 
 	/* The n+31: +30 for "<n>lvm2-activation-generator: " prefix and +1 for '\0' suffix */
-	(void) write(_kmsg_fd, message, n + 31);
+	if (write(_kmsg_fd, message, n + 31) < 0)
+		_error("Failed to write activation message %s: %m.\n", message);
 }
 
 //----------------------------------------------------------------