Check setmntent() for failures
This commit is contained in:
parent
005e90a7ff
commit
3bb0f0fbdd
@ -36,6 +36,8 @@ main(int argc, char *argv[])
|
||||
FILE *fp;
|
||||
|
||||
fp = setmntent("/etc/fstab", "r");
|
||||
if (!fp)
|
||||
eprintf("setmntent %s:", "/etc/fstab");
|
||||
while ((me = getmntent(fp)) != NULL) {
|
||||
if (strcmp(me->mnt_type, MNTTYPE_SWAP) == 0) {
|
||||
if (swapoff(me->mnt_fsname) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user