mirror of git://git.suckless.org/ubase
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)) {
|
||||
parse_modline(buf, &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;
|
||||
if (users[len] == ',' || users[len] == '-')
|
||||
users[len] = '\0';
|
||||
|
|
8
mkswap.c
8
mkswap.c
|
@ -49,7 +49,7 @@ main(int argc, char *argv[])
|
|||
if (pagesize <= 0) {
|
||||
pagesize = sysconf(_SC_PAGE_SIZE);
|
||||
if (pagesize <= 0)
|
||||
enprintf(EXIT_FAILURE, "can't determine pagesize\n");
|
||||
eprintf("can't determine pagesize\n");
|
||||
}
|
||||
|
||||
fd = open(argv[0], O_RDWR);
|
||||
|
@ -64,8 +64,8 @@ main(int argc, char *argv[])
|
|||
|
||||
pages = sb.st_size / pagesize;
|
||||
if (pages < SWAP_MIN_PAGES)
|
||||
enprintf(EXIT_FAILURE, "swap space needs to be at least %ldKiB\n",
|
||||
SWAP_MIN_PAGES * pagesize / 1024);
|
||||
eprintf("swap space needs to be at least %ldKiB\n",
|
||||
SWAP_MIN_PAGES * pagesize / 1024);
|
||||
|
||||
/* Fill up the swap header */
|
||||
hdr = (struct swap_hdr *)buf;
|
||||
|
@ -78,7 +78,7 @@ main(int argc, char *argv[])
|
|||
|
||||
/* Write out the signature page */
|
||||
if (write(fd, buf, pagesize) != pagesize)
|
||||
enprintf(EXIT_FAILURE, "unable to write signature page\n");
|
||||
eprintf("unable to write signature page\n");
|
||||
|
||||
fsync(fd);
|
||||
close(fd);
|
||||
|
|
5
mount.c
5
mount.c
|
@ -118,7 +118,7 @@ main(int argc, char *argv[])
|
|||
break;
|
||||
}
|
||||
if (oflag && !validopt)
|
||||
enprintf(EXIT_FAILURE, "unknown option: %s\n", opt->name);
|
||||
eprintf("unknown option: %s\n", opt->name);
|
||||
|
||||
source = argv[0];
|
||||
target = argv[1];
|
||||
|
@ -142,8 +142,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
endmntent(fp);
|
||||
if (!source)
|
||||
enprintf(EXIT_FAILURE, "can't find %s mountpoint\n",
|
||||
target);
|
||||
eprintf("can't find %s mountpoint\n", target);
|
||||
}
|
||||
|
||||
if (mount(source, target, types, flags, data) < 0)
|
||||
|
|
|
@ -24,7 +24,7 @@ main(int argc, char *argv[])
|
|||
if (pagesz <= 0) {
|
||||
pagesz = sysconf(_SC_PAGE_SIZE);
|
||||
if (pagesz <= 0)
|
||||
enprintf(EXIT_FAILURE, "can't determine pagesize\n");
|
||||
eprintf("can't determine pagesize\n");
|
||||
}
|
||||
printf("%ld\n", pagesz);
|
||||
return EXIT_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue