[hackers] [ubase] Check FIFREEZE/FITHAW ioctl for failure || sin

From: <git_AT_suckless.org>
Date: Thu, 26 Jun 2014 17:26:23 +0200

commit 23678b96cd3e6e66a790eee6d4ec0594197ba33c
Author: sin <sin_AT_2f30.org>
Date: Thu Jun 26 16:17:57 2014 +0100

    Check FIFREEZE/FITHAW ioctl for failure

diff --git a/fsfreeze.c b/fsfreeze.c
index f3af719..e47b6b4 100644
--- a/fsfreeze.c
+++ b/fsfreeze.c
_AT_@ -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;
 }
Received on Thu Jun 26 2014 - 17:26:23 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 26 2014 - 17:36:09 CEST