]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: provide alternatives for err, errx, warn and warnx
authorFabian Groffen <grobian@gentoo.org>
Tue, 25 Jan 2011 21:44:52 +0000 (22:44 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Feb 2011 16:45:24 +0000 (17:45 +0100)
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
52 files changed:
configure.ac
disk-utils/swaplabel.c
include/c.h
include/xalloc.h
lib/at.c
lib/blkdev.c
lib/cpuset.c
lib/mangle.c
lib/strutils.c
lib/tt.c
login-utils/chfn.c
login-utils/chsh.c
login-utils/last.c
login-utils/login.c
login-utils/mesg.c
login-utils/newgrp.c
login-utils/vipw.c
login-utils/wall.c
misc-utils/cal.c
misc-utils/findfs.c
misc-utils/findmnt.c
misc-utils/lsblk.c
misc-utils/namei.c
misc-utils/scriptreplay.c
misc-utils/wipefs.c
mount/swapon.c
partx/partx.c
schedutils/chrt.c
schedutils/ionice.c
schedutils/taskset.c
shlibs/blkid/samples/mkfs.c
shlibs/blkid/samples/partitions.c
shlibs/blkid/samples/superblocks.c
shlibs/blkid/samples/topology.c
shlibs/mount/samples/mount.c
shlibs/mount/src/lock.c
sys-utils/ctrlaltdel.c
sys-utils/fallocate.c
sys-utils/fsfreeze.c
sys-utils/fstrim.c
sys-utils/ipcmk.c
sys-utils/ipcs.c
sys-utils/ldattach.c
sys-utils/lscpu.c
sys-utils/renice.c
sys-utils/rtcwake.c
sys-utils/switch_root.c
sys-utils/unshare.c
text-utils/column.c
text-utils/rev.c
text-utils/tailf.c
text-utils/ul.c

index ee3e71e909dce1c06f40d259422996b977334bbb..7b5ffff1861a39b52891a18a22bc61b049ab3a2c 100644 (file)
@@ -175,6 +175,8 @@ AC_CHECK_DECL([lseek64],
 
 AC_CHECK_FUNCS(
        [inet_aton \
+       err \
+       errx \
        futimens \
        fstat64 \
        fsync \
@@ -204,6 +206,8 @@ AC_CHECK_FUNCS(
        posix_fadvise \
        getmntinfo \
        __secure_getenv \
+       warn \
+       warnx \
        rpmatch])
 AC_FUNC_FSEEKO
 
index 9dc20b49e887361e7f53a7a9e3f4680a0cd45ac1..86b3199e4ac4ddcc9127d477601c9bfbd849ee8f 100644 (file)
@@ -18,7 +18,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <err.h>
 #include <blkid.h>
 #include <getopt.h>
 
index 81546388151708bbb7cc776fbed925855282ce8f..0db8b2b59053fff229ddd99c64b1868437d885e2 100644 (file)
@@ -6,6 +6,15 @@
 #define UTIL_LINUX_C_H
 
 #include <limits.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef HAVE_ERR_H
+# include <err.h>
+#endif
 
 /*
  * Compiler specific stuff
 #endif
 
 
+#ifndef HAVE_ERR_H
+static inline void
+errmsg(char doexit, int excode, char adderr, const char *fmt, ...)
+{
+       fprintf(stderr, "%s: ", program_invocation_short_name);
+       if (fmt != NULL) {
+               va_list argp;
+               va_start(argp, fmt);
+               vfprintf(stderr, fmt, argp);
+               va_end(argp);
+               if (adderr)
+                       fprintf(stderr, ": ");
+       }
+       if (adderr)
+               fprintf(stderr, "%s", strerror(errno));
+       fprintf(stderr, "\n");
+       if (doexit)
+               exit(excode);
+}
+
+#ifndef HAVE_ERR
+# define err(E, FMT...) errmsg(1, E, 1, FMT)
+#endif
+
+#ifndef HAVE_ERRX
+# define errx(E, FMT...) errmsg(1, E, 0, FMT)
+#endif
+
+#ifndef HAVE_WARN
+# define warn(FMT...) errmsg(0, 0, 1, FMT)
+#endif
+
+#ifndef HAVE_WARNX
+# define warnx(FMT...) errmsg(0, 0, 0, FMT)
+#endif
+#endif /* !HAVE_ERR_H */
+
+
 static inline __attribute__((const)) int is_power_of_2(unsigned long num)
 {
        return (num != 0 && ((num & (num - 1)) == 0));
index 841333c30886aa1aa08a3257875cbdcfe25fd60f..0e9ee32487f36b7fe3926abf49c586f573ceb745 100644 (file)
@@ -11,7 +11,6 @@
 #define UTIL_LINUX_XALLOC_H
 
 #include <stdlib.h>
-#include <err.h>
 #include <string.h>
 
 #include "c.h"
index 1993f99831e519cf088790d9dcf5f005f8910791..dd667b5b8fafa04335545d4a990647b55c876d9a 100644 (file)
--- a/lib/at.c
+++ b/lib/at.c
@@ -9,6 +9,7 @@
 #include <sys/stat.h>
 
 #include "at.h"
+#include "c.h"
 
 int fstat_at(int dir, const char *dirname, const char *filename,
                                struct stat *st, int nofollow)
@@ -56,7 +57,6 @@ FILE *fopen_at(int dir, const char *dirname, const char *filename, int flags,
 }
 
 #ifdef TEST_PROGRAM
-#include <err.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <dirent.h>
index 67c4a1ac27b6765e76f879b83fbd92b216ab5d34..0c27a6df936c06233defb124e719ec4be9a5717d 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "blkdev.h"
 #include "linux_version.h"
+#include "c.h"
 
 static long
 blkdev_valid_offset (int fd, off_t offset) {
@@ -208,7 +209,6 @@ blkdev_get_sector_size(int fd, int *sector_size)
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
-#include <err.h>
 int
 main(int argc, char **argv)
 {
index 0c483fa5e3b2929cda8f3d300b8d0bf496c08d1b..8cd706ce41cf8fd2adb6ef8bc2abae61e4a0200a 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/syscall.h>
 
 #include "cpuset.h"
+#include "c.h"
 
 static inline int val_to_char(int v)
 {
@@ -303,7 +304,6 @@ int cpulist_parse(const char *str, cpu_set_t *set, size_t setsize)
 
 #ifdef TEST_PROGRAM
 
-#include <err.h>
 #include <getopt.h>
 
 int main(int argc, char *argv[])
index 17ca80951cbff187ce37cb674af19eef7390f0e9..99e8281e62eb5f43c40fac4b39b94e88b7551c6a 100644 (file)
@@ -11,6 +11,7 @@
 #include <ctype.h>
 
 #include "mangle.h"
+#include "c.h"
 
 #define isoctal(a) (((a) & ~7) == '0')
 
@@ -103,7 +104,6 @@ char *unmangle(const char *s, char **end)
 }
 
 #ifdef TEST_PROGRAM
-#include <err.h>
 #include <errno.h>
 int main(int argc, char *argv[])
 {
index 94635b1e8951b34d67def26f92add1810356c17e..8089fbe8b3502ba937b0c4c19e77558dfbd42c26 100644 (file)
@@ -8,10 +8,10 @@
 #include <inttypes.h>
 #include <ctype.h>
 #include <errno.h>
-#include <err.h>
 #include <sys/stat.h>
 #include <locale.h>
 #include <string.h>
+#include "c.h"
 
 static int do_scale_by_power (uintmax_t *x, int base, int power)
 {
index 3bcdea9e0ce4abf85e5b5fdbc34c5ec6d1d0e678..140149d0f3087fac7b6787bfcc7e32d7a4583a63 100644 (file)
--- a/lib/tt.c
+++ b/lib/tt.c
@@ -709,7 +709,6 @@ int tt_parse_columns_list(const char *list, int cols[], int *ncols,
 }
 
 #ifdef TEST_PROGRAM
-#include <err.h>
 #include <errno.h>
 
 enum { MYCOL_NAME, MYCOL_FOO, MYCOL_BAR, MYCOL_PATH };
index 64f4ac4298f327829d7081c72d4d5d2b897cf80b..7399b179f06a3299ad08f485d435d4501f22be83 100644 (file)
@@ -30,7 +30,6 @@
 #include <unistd.h>
 #include <pwd.h>
 #include <errno.h>
-#include <err.h>
 #include <ctype.h>
 #include <getopt.h>
 
@@ -44,6 +43,7 @@
 #include "nls.h"
 #include "env.h"
 #include "xalloc.h"
+#include "c.h"
 
 #ifdef HAVE_LIBSELINUX
 #include <selinux/selinux.h>
index 778c4578b8e66cf8b4733c267fabd92f78c0c362..fe610726f93678ee84edd078dab984103d738717 100644 (file)
@@ -22,7 +22,6 @@
  *
  *
  */
-#include <err.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <string.h>
index de733cd58776c9a5359370d14aea590e632f8201..732343d4450ccac7384d97b179d2d631ed597f9d 100644 (file)
@@ -29,7 +29,6 @@
 /*
  * last
  */
-#include <err.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/file.h>
@@ -51,6 +50,7 @@
 #include "pathnames.h"
 #include "nls.h"
 #include "xalloc.h"
+#include "c.h"
 
 #define        SECDAY  (24*60*60)                      /* seconds in a day */
 #define        NO      0                               /* false/no */
index 5584c320267c87c8743029c81356771ba5bcb30d..5486ad9189173993caf75cf565e263ae915ffc70 100644 (file)
@@ -97,7 +97,6 @@
 #include <sys/wait.h>
 #include <signal.h>
 #include <errno.h>
-#include <err.h>
 #include <grp.h>
 #include <pwd.h>
 #include <utmp.h>
 #include "strutils.h"
 #include "nls.h"
 #include "xalloc.h"
+#include "c.h"
 
 #ifdef HAVE_SECURITY_PAM_MISC_H
 #  include <security/pam_appl.h>
index c24a10926a87b3178eb3d1569041e316f41695f0..6176aabfbede75ca02c09a749f550f2dd26ca317 100644 (file)
@@ -46,7 +46,6 @@
  * - cleanups
  */
 
-#include <err.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -55,6 +54,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include "nls.h"
+#include "c.h"
 
 /* exit codes */
 
index 2ffe3873445f24cec7ca5f76aa99bb07537933fb..7016cfa635b66e8d88fa06ec42f7ecb2fe1d2abe 100644 (file)
@@ -14,7 +14,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <err.h>
 
 #ifdef HAVE_CRYPT_H
 #include <crypt.h>
index 5750e6f92d6af4859126629310169562d04e3365..d3ae51ef9c0e2cf3582e8ce8c119de814d2ec41b 100644 (file)
@@ -60,13 +60,13 @@ static char version_string[] = "vipw 1.4";
 #include <signal.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <err.h>
 #include <paths.h>
 #include <unistd.h>
 
 #include "setpwnam.h"
 #include "strutils.h"
 #include "nls.h"
+#include "c.h"
 
 #ifdef HAVE_LIBSELINUX
 #include <selinux/selinux.h>
index fc4d792c4d97440d64621997b918f8b4d447c508..bc2e38288ee1b14aacbf34840c8262b0c7ad9481 100644 (file)
@@ -47,7 +47,6 @@
 #include <sys/time.h>
 #include <sys/uio.h>
 
-#include <err.h>
 #include <errno.h>
 #include <paths.h>
 #include <ctype.h>
@@ -65,6 +64,7 @@
 #include "ttymsg.h"
 #include "pathnames.h"
 #include "carefulputc.h"
+#include "c.h"
 
 void   makemsg __P((char *));
 
index 896c45339148976aa7da5845f048ccb0db3f9c32..1e5e2cd8fb7d56257cafb2061964fb968eec05a9 100644 (file)
@@ -63,7 +63,6 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
-#include <err.h>
 #include <errno.h>
 
 #include "c.h"
index 18608b47060afbe8cd00d4caa566a17a3e3e62ea..04651b3a5dde8a1d225adb5c956a8e9048571dce 100644 (file)
@@ -8,11 +8,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include <err.h>
 
 #include <blkid.h>
 
 #include "nls.h"
+#include "c.h"
 
 static void __attribute__((__noreturn__)) usage(int rc)
 {
index f81a0c87fc8f162791c6cb8ed9c2fa546948142b..19a15fb583b58104b3558259c9154eb9b19ae3e6 100644 (file)
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <err.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <string.h>
index b07bfb49a679dd935e50948541a376b5e8ec78ba..2eb6900ac704f4987347a04503e6c44fbc950959 100644 (file)
@@ -31,7 +31,6 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <string.h>
-#include <err.h>
 #include <sys/ioctl.h>
 #include <inttypes.h>
 #include <stdarg.h>
@@ -51,6 +50,7 @@
 #include "tt.h"
 #include "xalloc.h"
 #include "strutils.h"
+#include "c.h"
 
 /* column IDs */
 enum {
index 1c20b3777d89b70baf6e12966c674e183978a306..2115fe7c9fc937caf554ddc92e910f1c6c7bd6e7 100644 (file)
@@ -30,7 +30,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
-#include <err.h>
 #include <pwd.h>
 #include <grp.h>
 
index e13edf37e2f9d51610070cffe23bb65a2ae55591..f8ee9e011c350f618e7f237a0a9a9d56b6374d29 100644 (file)
@@ -26,9 +26,9 @@
 #include <math.h>
 #include <sys/select.h>
 #include <unistd.h>
-#include <err.h>
 
 #include "nls.h"
+#include "c.h"
 
 #define SCRIPT_MIN_DELAY 0.0001                /* from original sripreplay.pl */
 
index 079a9bccfa241a2656d276a664939a269cbfaeb8..9016f2f40713a27225b38aebb00e5a696b319385 100644 (file)
@@ -27,7 +27,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <getopt.h>
-#include <err.h>
 #include <string.h>
 #include <limits.h>
 
@@ -37,6 +36,7 @@
 #include "xalloc.h"
 #include "strutils.h"
 #include "writeall.h"
+#include "c.h"
 
 struct wipe_desc {
        loff_t          offset;         /* magic string offset */
index 5c9c3be432c1e6b4324297910474e770218f1ee8..49771f5d7638ea30eee29413b82e4b176e5b5879 100644 (file)
@@ -13,7 +13,6 @@
 #include <sys/wait.h>
 #include <fcntl.h>
 #include <stdint.h>
-#include <err.h>
 #include <ctype.h>
 
 #include "bitops.h"
@@ -25,6 +24,7 @@
 #include "swapheader.h"
 #include "mangle.h"
 #include "canonicalize.h"
+#include "c.h"
 
 #define PATH_MKSWAP    "/sbin/mkswap"
 
index a65586f12bdfe44d0c1589fe8d0d952f84c264fc..1a60cb4559930fb2f3d4e57fc393c84459eb61b5 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <stdio.h>
 #include <fcntl.h>
-#include <err.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
index bd7070cca589714ac9c87dec96336b843abc797d..489f299885f2bac058c42408e061ec1f5bb36356 100644 (file)
@@ -27,7 +27,6 @@
 #include <unistd.h>
 #include <getopt.h>
 #include <errno.h>
-#include <err.h>
 
 #include "c.h"
 #include "nls.h"
index ecfb4fd0547c63ee1ba04c6eb1085ce94143a100..dc18add60e93d03984029aa3fc267547885008fc 100644 (file)
 #include <getopt.h>
 #include <unistd.h>
 #include <sys/syscall.h>
-#include <err.h>
 
 #include "nls.h"
-
 #include "strutils.h"
+#include "c.h"
 
 static int tolerant;
 
index fa16647da1840130f1fd6401496a2ab6f17298d8..39b22452ed498dd768c7066f0a5a4f83eb3f4406 100644 (file)
 #include <unistd.h>
 #include <getopt.h>
 #include <errno.h>
-#include <err.h>
 
 #include "cpuset.h"
 #include "nls.h"
-
 #include "strutils.h"
+#include "c.h"
 
 static void __attribute__((__noreturn__)) usage(FILE *out)
 {
index ff6a6322ddf8230990fef06d9c41eaac3321b87a..5c3ebe79e47042694988eec96ee23ce1932ba3bf 100644 (file)
@@ -10,7 +10,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <err.h>
 #include <errno.h>
 
 #include <blkid.h>
index 8ee55996929e6ed76cda1a0f24ddfc9f3a1d1aca..3b5273649409650b39009d886eeaba5d7f82e50e 100644 (file)
@@ -10,7 +10,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <err.h>
 #include <errno.h>
 
 #include <blkid.h>
index 276c29e6f4d87a88e9ac7f55976333c887ef5c0e..20e39c97ef142d1bbfa435eac39744a156b694f1 100644 (file)
@@ -10,7 +10,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <err.h>
 #include <errno.h>
 
 #include <blkid.h>
index e73cd9e4518e2ec78527e4b55a67c154f7f7f97b..de1c3a5e39d2a721d429465d82a713a4a4970f39 100644 (file)
@@ -10,7 +10,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <err.h>
 #include <errno.h>
 
 #include <blkid.h>
index 8095ffccbed14fe7df0751ce9829f0937c38591a..38960f8dc6c18424ebb41b9d94098e3181a56fa4 100644 (file)
@@ -24,7 +24,6 @@
 #include <errno.h>
 #include <string.h>
 #include <getopt.h>
-#include <err.h>
 #include <unistd.h>
 #include <sys/types.h>
 
index ef7498d978e0456edaa661f3f6a36e8d3ccd6e12..554915876ec5bff01bd4415db59353a674ffd141 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "pathnames.h"
 #include "nls.h"
+#include "c.h"
 
 #include "mountP.h"
 
@@ -429,7 +430,6 @@ failed:
 }
 
 #ifdef TEST_PROGRAM
-#include <err.h>
 
 struct libmnt_lock *lock;
 
index cfab79a3ecad35ba8596d1fd8892e6bad4f7d863..d6c83b42f0a22fed4a3e2b23446fb78c6edd8bb9 100644 (file)
@@ -5,13 +5,13 @@
  * - added Native Language Support
  */
 
-#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include "linux_reboot.h"
 #include "nls.h"
+#include "c.h"
 
 int main(int argc, char *argv[])
 {
index e9d7c079afd3952810d09e107767a90879ee5b32..74e9435fe5a497d130077cda5daa08d5669852fd 100644 (file)
@@ -30,7 +30,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <getopt.h>
-#include <err.h>
 #include <limits.h>
 
 #ifndef HAVE_FALLOCATE
@@ -45,6 +44,7 @@
 
 #include "nls.h"
 #include "strutils.h"
+#include "c.h"
 
 
 static void __attribute__((__noreturn__)) usage(FILE *out)
index 4ca6e5e2a5d43811a7dd18bef641ca07aefee414..2dab23f49635fb956c7b769de00b9a1cc69f6e99 100644 (file)
@@ -20,7 +20,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <getopt.h>
-#include <err.h>
 
 #include "blkdev.h"
 #include "nls.h"
index 808ff0334dfc3a539611b1548ccc7e16a8863bb4..a3a84752230c7a1f3ff5a181697b3cf3a47e5591 100644 (file)
@@ -32,7 +32,6 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <getopt.h>
-#include <err.h>
 #include <error.h>
 #include <errno.h>
 
@@ -42,6 +41,7 @@
 
 #include "nls.h"
 #include "strutils.h"
+#include "c.h"
 
 #ifndef FITRIM
 struct fstrim_range {
index 2e663bf024247d85840d8e9b3b39b0ead2616edc..26bf8f6bcbea9615e675aba8f575e170852d6c88 100644 (file)
@@ -23,7 +23,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <err.h>
 #include <time.h>
 
 #include <unistd.h>
@@ -34,6 +33,7 @@
 #include <sys/msg.h>
 
 #include "nls.h"
+#include "c.h"
 
 static const char *progname;
 
index 2ef5788deef68c4824c0d7111972f6dbb118335d..533aaeb6681d60b0b58bbf66536734c02fd48a1f 100644 (file)
@@ -26,7 +26,6 @@
 #include <pwd.h>
 #include <grp.h>
 #include <unistd.h>
-#include <err.h>
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -34,6 +33,7 @@
 #include <sys/shm.h>
 
 #include "nls.h"
+#include "c.h"
 
 /*-------------------------------------------------------------------*/
 /* SHM_DEST and SHM_LOCKED are defined in kernel headers,
index 4fe5a7bb6cfbdbd5ea6ca48c88f63d658f6bce22..5d83819586ccb99268a225d390920a5f11c62a66 100644 (file)
@@ -23,7 +23,6 @@
 #include <errno.h>
 #include <termios.h>
 #include <unistd.h>
-#include <err.h>
 
 #include "c.h"
 #include "nls.h"
index d59d2e2318aefba6693e3e3cb72d4853cd47c415..373fee14a59b87d733949bbbd597b13358718258 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <ctype.h>
 #include <dirent.h>
-#include <err.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
@@ -37,6 +36,7 @@
 
 #include "cpuset.h"
 #include "nls.h"
+#include "c.h"
 
 #define CACHE_MAX 100
 
index 6b1a9726b01398339821a4c0bf3e0697af7dc75e..b4d96e02f9716b9af336a7388f8d2f13eb141239 100644 (file)
@@ -44,8 +44,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include <err.h>
 #include "nls.h"
+#include "c.h"
 
 static int donice(int,int,int);
 
index 06f5c3839294f68654af91b772362148ba074433..da8c085feaec745479a419f869a540a2a835705b 100644 (file)
@@ -28,7 +28,6 @@
 #include <unistd.h>
 #include <errno.h>
 #include <time.h>
-#include <err.h>
 
 #include <sys/ioctl.h>
 #include <sys/time.h>
@@ -41,6 +40,7 @@
 #include "pathnames.h"
 #include "usleep.h"
 #include "strutils.h"
+#include "c.h"
 
 /* constants from legacy PC/AT hardware */
 #define        RTC_PF  0x40
index c43225da2e14dbc671251a037caef022b5b35c40..2dfed71a065ca86f4ce5dce015248e9fb7c8f8f7 100644 (file)
@@ -32,7 +32,7 @@
 #include <errno.h>
 #include <ctype.h>
 #include <dirent.h>
-#include <err.h>
+#include "c.h"
 
 #ifndef MS_MOVE
 #define MS_MOVE 8192
index 12a725e3b1684cafa73141f8adb17cc5149f81f0..343a86ee39c508604841d254a73ecad9884ec6e3 100644 (file)
@@ -18,7 +18,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <err.h>
 #include <errno.h>
 #include <getopt.h>
 #include <sched.h>
@@ -27,6 +26,7 @@
 #include <unistd.h>
 
 #include "nls.h"
+#include "c.h"
 
 #ifndef CLONE_NEWSNS
 # define CLONE_NEWNS 0x00020000
index 156de7059169eab7624ea0fc12dd45a832d2e1d3..5c6db257ed66620551259e22c629a27a09c22c97 100644 (file)
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <err.h>
 #include <errno.h>
 #include <getopt.h>
 #include "nls.h"
 
 #include "widechar.h"
+#include "c.h"
 
 #ifdef HAVE_WIDECHAR
 #define wcs_width(s) wcswidth(s,wcslen(s))
index b69244971f766ec3ad5be0c3c44c600ab0629f72..89e5e585548ce5f6a63b1b582066fd27635f3c74 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <err.h>
 #include <signal.h>
 
 #include "nls.h"
 #include "xalloc.h"
 #include "widechar.h"
+#include "c.h"
 
 wchar_t *buf;
 
index 2dcdba3f3d1d6505211369caa4206b4387bf2946..c995d979cdd9f14cfcbfd8fba31f3220f1cc6e4b 100644 (file)
@@ -35,7 +35,6 @@
 #include <fcntl.h>
 #include <ctype.h>
 #include <errno.h>
-#include <err.h>
 #ifdef HAVE_INOTIFY_INIT
 #include <sys/inotify.h>
 #endif
@@ -43,6 +42,7 @@
 #include "nls.h"
 #include "xalloc.h"
 #include "usleep.h"
+#include "c.h"
 
 #define DEFAULT_LINES  10
 
index 30f24e9d5c0af694a9f99a99ff55bfe260dd1388..dc0550cc01c2fbb8672e69453e996f607b89aef5 100644 (file)
 #include <stdlib.h>            /* for getenv() */
 #include <limits.h>            /* for INT_MAX */
 #include <signal.h>            /* for signal() */
-#include <err.h>
 #include <errno.h>
 
 #include "nls.h"
 #include "xalloc.h"
 #include "widechar.h"
+#include "c.h"
 
 #ifdef HAVE_WIDECHAR
 static int put1wc(int c) /* Output an ASCII character as a wide character */