commit: b5e31e30274e100c2416a2ff6839d79ecb005720
parent: ac87ab150f2422b2a5a7ad006690018fddaea576
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 6 May 2020 08:44:05 +0200
sbin/memsys: fix write() call
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sbin/memsys.c b/sbin/memsys.c
@@ -19,7 +19,10 @@ int main(void) {
perror("memsys: open(\""SYS_POWER_STATE"\")");
err++;
} else {
- write(fd, &entry, entry_size);
+ if(write(fd, entry, entry_size) < (ssize_t)entry_size) {
+ perror("memsys: write(fd, \"mem\", 3)");
+ err++;
+ }
close(fd);
}