commit 23678b96cd3e6e66a790eee6d4ec0594197ba33c
parent c88ba3750ec6e139034e468d5a56166268188981
Author: sin <sin@2f30.org>
Date: Thu, 26 Jun 2014 16:17:57 +0100
Check FIFREEZE/FITHAW ioctl for failure
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsfreeze.c b/fsfreeze.c
@@ -45,7 +45,8 @@ main(int argc, char *argv[])
fd = open(argv[0], O_RDONLY);
if (fd < 0)
eprintf("open: %s:", argv[0]);
- ioctl(fd, fflag == 1 ? FIFREEZE : FITHAW, &p);
+ if (ioctl(fd, fflag == 1 ? FIFREEZE : FITHAW, &p) < 0)
+ eprintf("%s %s:", fflag == 1 ? "FIFREEZE" : "FITHAW", argv[0]);
close(fd);
return EXIT_SUCCESS;
}