ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit d0dc4dc2b7cdd3cabd339342d13fd994bdba2d6a
parent 634e77a1a54de28c94ab9f8d763b90e5eaef3a79
Author: sin <sin@2f30.org>
Date:   Thu, 27 Feb 2014 15:08:17 +0000

Fix some more instances of enprintf(EXIT_FAILURE, ...);

Diffstat:
Mlsmod.c | 2+-
Mmkswap.c | 8++++----
Mmount.c | 5++---
Mpagesize.c | 2+-
4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/lsmod.c b/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'; diff --git a/mkswap.c b/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); diff --git a/mount.c b/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) diff --git a/pagesize.c b/pagesize.c @@ -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;