Fix some more instances of enprintf(EXIT_FAILURE, ...);
This commit is contained in:
parent
634e77a1a5
commit
d0dc4dc2b7
2
lsmod.c
2
lsmod.c
@ -38,7 +38,7 @@ main(int argc, char *argv[])
|
|||||||
while (fgets(buf, sizeof buf, fp)) {
|
while (fgets(buf, sizeof buf, fp)) {
|
||||||
parse_modline(buf, &name, &size, &refcount, &users);
|
parse_modline(buf, &name, &size, &refcount, &users);
|
||||||
if (!name || !size || !refcount || !users)
|
if (!name || !size || !refcount || !users)
|
||||||
enprintf(1, "invalid format: %s\n", modfile);
|
eprintf("invalid format: %s\n", modfile);
|
||||||
len = strlen(users) - 1;
|
len = strlen(users) - 1;
|
||||||
if (users[len] == ',' || users[len] == '-')
|
if (users[len] == ',' || users[len] == '-')
|
||||||
users[len] = '\0';
|
users[len] = '\0';
|
||||||
|
8
mkswap.c
8
mkswap.c
@ -49,7 +49,7 @@ main(int argc, char *argv[])
|
|||||||
if (pagesize <= 0) {
|
if (pagesize <= 0) {
|
||||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||||
if (pagesize <= 0)
|
if (pagesize <= 0)
|
||||||
enprintf(EXIT_FAILURE, "can't determine pagesize\n");
|
eprintf("can't determine pagesize\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = open(argv[0], O_RDWR);
|
fd = open(argv[0], O_RDWR);
|
||||||
@ -64,8 +64,8 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
pages = sb.st_size / pagesize;
|
pages = sb.st_size / pagesize;
|
||||||
if (pages < SWAP_MIN_PAGES)
|
if (pages < SWAP_MIN_PAGES)
|
||||||
enprintf(EXIT_FAILURE, "swap space needs to be at least %ldKiB\n",
|
eprintf("swap space needs to be at least %ldKiB\n",
|
||||||
SWAP_MIN_PAGES * pagesize / 1024);
|
SWAP_MIN_PAGES * pagesize / 1024);
|
||||||
|
|
||||||
/* Fill up the swap header */
|
/* Fill up the swap header */
|
||||||
hdr = (struct swap_hdr *)buf;
|
hdr = (struct swap_hdr *)buf;
|
||||||
@ -78,7 +78,7 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Write out the signature page */
|
/* Write out the signature page */
|
||||||
if (write(fd, buf, pagesize) != pagesize)
|
if (write(fd, buf, pagesize) != pagesize)
|
||||||
enprintf(EXIT_FAILURE, "unable to write signature page\n");
|
eprintf("unable to write signature page\n");
|
||||||
|
|
||||||
fsync(fd);
|
fsync(fd);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
5
mount.c
5
mount.c
@ -118,7 +118,7 @@ main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (oflag && !validopt)
|
if (oflag && !validopt)
|
||||||
enprintf(EXIT_FAILURE, "unknown option: %s\n", opt->name);
|
eprintf("unknown option: %s\n", opt->name);
|
||||||
|
|
||||||
source = argv[0];
|
source = argv[0];
|
||||||
target = argv[1];
|
target = argv[1];
|
||||||
@ -142,8 +142,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
endmntent(fp);
|
endmntent(fp);
|
||||||
if (!source)
|
if (!source)
|
||||||
enprintf(EXIT_FAILURE, "can't find %s mountpoint\n",
|
eprintf("can't find %s mountpoint\n", target);
|
||||||
target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mount(source, target, types, flags, data) < 0)
|
if (mount(source, target, types, flags, data) < 0)
|
||||||
|
@ -24,7 +24,7 @@ main(int argc, char *argv[])
|
|||||||
if (pagesz <= 0) {
|
if (pagesz <= 0) {
|
||||||
pagesz = sysconf(_SC_PAGE_SIZE);
|
pagesz = sysconf(_SC_PAGE_SIZE);
|
||||||
if (pagesz <= 0)
|
if (pagesz <= 0)
|
||||||
enprintf(EXIT_FAILURE, "can't determine pagesize\n");
|
eprintf("can't determine pagesize\n");
|
||||||
}
|
}
|
||||||
printf("%ld\n", pagesz);
|
printf("%ld\n", pagesz);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user