Check FIFREEZE/FITHAW ioctl for failure

This commit is contained in:
sin 2014-06-26 16:17:57 +01:00
parent c88ba3750e
commit 23678b96cd
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}