diff options
author | Fabian Groffen <grobian@gentoo.org> | 2011-01-25 22:44:52 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2011-02-14 17:45:24 +0100 |
commit | eb76ca98b0733754d7e9a40f754e89b50af2bf06 (patch) | |
tree | f2becaf31f77a664256273e6ec6772904422ac53 | |
parent | 4a01477b12bc6c7ced2306e2700021672f43a4a0 (diff) | |
download | util-linux-eb76ca98b0733754d7e9a40f754e89b50af2bf06.tar.gz |
build-sys: provide alternatives for err, errx, warn and warnx
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, 84 insertions, 52 deletions
diff --git a/configure.ac b/configure.ac index ee3e71e9..7b5ffff1 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c index 9dc20b49..86b3199e 100644 --- a/disk-utils/swaplabel.c +++ b/disk-utils/swaplabel.c @@ -18,7 +18,6 @@ #include <sys/stat.h> #include <unistd.h> #include <stdlib.h> -#include <err.h> #include <blkid.h> #include <getopt.h> diff --git a/include/c.h b/include/c.h index 81546388..0db8b2b5 100644 --- a/include/c.h +++ b/include/c.h @@ -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 @@ -95,6 +104,44 @@ #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)); diff --git a/include/xalloc.h b/include/xalloc.h index 841333c3..0e9ee324 100644 --- a/include/xalloc.h +++ b/include/xalloc.h @@ -11,7 +11,6 @@ #define UTIL_LINUX_XALLOC_H #include <stdlib.h> -#include <err.h> #include <string.h> #include "c.h" @@ -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> diff --git a/lib/blkdev.c b/lib/blkdev.c index 67c4a1ac..0c27a6df 100644 --- a/lib/blkdev.c +++ b/lib/blkdev.c @@ -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) { diff --git a/lib/cpuset.c b/lib/cpuset.c index 0c483fa5..8cd706ce 100644 --- a/lib/cpuset.c +++ b/lib/cpuset.c @@ -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[]) diff --git a/lib/mangle.c b/lib/mangle.c index 17ca8095..99e8281e 100644 --- a/lib/mangle.c +++ b/lib/mangle.c @@ -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[]) { diff --git a/lib/strutils.c b/lib/strutils.c index 94635b1e..8089fbe8 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -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) { @@ -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 }; diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 64f4ac42..7399b179 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -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> diff --git a/login-utils/chsh.c b/login-utils/chsh.c index 778c4578..fe610726 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -22,7 +22,6 @@ * * */ -#include <err.h> #include <sys/types.h> #include <stdio.h> #include <string.h> diff --git a/login-utils/last.c b/login-utils/last.c index de733cd5..732343d4 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -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 */ diff --git a/login-utils/login.c b/login-utils/login.c index 5584c320..5486ad91 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -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> @@ -120,6 +119,7 @@ #include "strutils.h" #include "nls.h" #include "xalloc.h" +#include "c.h" #ifdef HAVE_SECURITY_PAM_MISC_H # include <security/pam_appl.h> diff --git a/login-utils/mesg.c b/login-utils/mesg.c index c24a1092..6176aabf 100644 --- a/login-utils/mesg.c +++ b/login-utils/mesg.c @@ -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 */ diff --git a/login-utils/newgrp.c b/login-utils/newgrp.c index 2ffe3873..7016cfa6 100644 --- a/login-utils/newgrp.c +++ b/login-utils/newgrp.c @@ -14,7 +14,6 @@ #include <stdio.h> #include <stdlib.h> #include <errno.h> -#include <err.h> #ifdef HAVE_CRYPT_H #include <crypt.h> diff --git a/login-utils/vipw.c b/login-utils/vipw.c index 5750e6f9..d3ae51ef 100644 --- a/login-utils/vipw.c +++ b/login-utils/vipw.c @@ -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> diff --git a/login-utils/wall.c b/login-utils/wall.c index fc4d792c..bc2e3828 100644 --- a/login-utils/wall.c +++ b/login-utils/wall.c @@ -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 *)); diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 896c4533..1e5e2cd8 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -63,7 +63,6 @@ #include <string.h> #include <time.h> #include <unistd.h> -#include <err.h> #include <errno.h> #include "c.h" diff --git a/misc-utils/findfs.c b/misc-utils/findfs.c index 18608b47..04651b3a 100644 --- a/misc-utils/findfs.c +++ b/misc-utils/findfs.c @@ -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) { diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index f81a0c87..19a15fb5 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -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> diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index b07bfb49..2eb6900a 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -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 { diff --git a/misc-utils/namei.c b/misc-utils/namei.c index 1c20b377..2115fe7c 100644 --- a/misc-utils/namei.c +++ b/misc-utils/namei.c @@ -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> diff --git a/misc-utils/scriptreplay.c b/misc-utils/scriptreplay.c index e13edf37..f8ee9e01 100644 --- a/misc-utils/scriptreplay.c +++ b/misc-utils/scriptreplay.c @@ -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 */ diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 079a9bcc..9016f2f4 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -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 */ diff --git a/mount/swapon.c b/mount/swapon.c index 5c9c3be4..49771f5d 100644 --- a/mount/swapon.c +++ b/mount/swapon.c @@ -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" diff --git a/partx/partx.c b/partx/partx.c index a65586f1..1a60cb45 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -13,7 +13,6 @@ #include <stdio.h> #include <fcntl.h> -#include <err.h> #include <errno.h> #include <stdlib.h> #include <string.h> diff --git a/schedutils/chrt.c b/schedutils/chrt.c index bd7070cc..489f2998 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -27,7 +27,6 @@ #include <unistd.h> #include <getopt.h> #include <errno.h> -#include <err.h> #include "c.h" #include "nls.h" diff --git a/schedutils/ionice.c b/schedutils/ionice.c index ecfb4fd0..dc18add6 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -12,11 +12,10 @@ #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; diff --git a/schedutils/taskset.c b/schedutils/taskset.c index fa16647d..39b22452 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -24,12 +24,11 @@ #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) { diff --git a/shlibs/blkid/samples/mkfs.c b/shlibs/blkid/samples/mkfs.c index ff6a6322..5c3ebe79 100644 --- a/shlibs/blkid/samples/mkfs.c +++ b/shlibs/blkid/samples/mkfs.c @@ -10,7 +10,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include <err.h> #include <errno.h> #include <blkid.h> diff --git a/shlibs/blkid/samples/partitions.c b/shlibs/blkid/samples/partitions.c index 8ee55996..3b527364 100644 --- a/shlibs/blkid/samples/partitions.c +++ b/shlibs/blkid/samples/partitions.c @@ -10,7 +10,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include <err.h> #include <errno.h> #include <blkid.h> diff --git a/shlibs/blkid/samples/superblocks.c b/shlibs/blkid/samples/superblocks.c index 276c29e6..20e39c97 100644 --- a/shlibs/blkid/samples/superblocks.c +++ b/shlibs/blkid/samples/superblocks.c @@ -10,7 +10,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include <err.h> #include <errno.h> #include <blkid.h> diff --git a/shlibs/blkid/samples/topology.c b/shlibs/blkid/samples/topology.c index e73cd9e4..de1c3a5e 100644 --- a/shlibs/blkid/samples/topology.c +++ b/shlibs/blkid/samples/topology.c @@ -10,7 +10,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include <err.h> #include <errno.h> #include <blkid.h> diff --git a/shlibs/mount/samples/mount.c b/shlibs/mount/samples/mount.c index 8095ffcc..38960f8d 100644 --- a/shlibs/mount/samples/mount.c +++ b/shlibs/mount/samples/mount.c @@ -24,7 +24,6 @@ #include <errno.h> #include <string.h> #include <getopt.h> -#include <err.h> #include <unistd.h> #include <sys/types.h> diff --git a/shlibs/mount/src/lock.c b/shlibs/mount/src/lock.c index ef7498d9..55491587 100644 --- a/shlibs/mount/src/lock.c +++ b/shlibs/mount/src/lock.c @@ -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; diff --git a/sys-utils/ctrlaltdel.c b/sys-utils/ctrlaltdel.c index cfab79a3..d6c83b42 100644 --- a/sys-utils/ctrlaltdel.c +++ b/sys-utils/ctrlaltdel.c @@ -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[]) { diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index e9d7c079..74e9435f 100644 --- a/sys-utils/fallocate.c +++ b/sys-utils/fallocate.c @@ -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) diff --git a/sys-utils/fsfreeze.c b/sys-utils/fsfreeze.c index 4ca6e5e2..2dab23f4 100644 --- a/sys-utils/fsfreeze.c +++ b/sys-utils/fsfreeze.c @@ -20,7 +20,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <getopt.h> -#include <err.h> #include "blkdev.h" #include "nls.h" diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c index 808ff033..a3a84752 100644 --- a/sys-utils/fstrim.c +++ b/sys-utils/fstrim.c @@ -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 { diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c index 2e663bf0..26bf8f6b 100644 --- a/sys-utils/ipcmk.c +++ b/sys-utils/ipcmk.c @@ -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; diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c index 2ef5788d..533aaeb6 100644 --- a/sys-utils/ipcs.c +++ b/sys-utils/ipcs.c @@ -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, diff --git a/sys-utils/ldattach.c b/sys-utils/ldattach.c index 4fe5a7bb..5d838195 100644 --- a/sys-utils/ldattach.c +++ b/sys-utils/ldattach.c @@ -23,7 +23,6 @@ #include <errno.h> #include <termios.h> #include <unistd.h> -#include <err.h> #include "c.h" #include "nls.h" diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index d59d2e23..373fee14 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -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 diff --git a/sys-utils/renice.c b/sys-utils/renice.c index 6b1a9726..b4d96e02 100644 --- a/sys-utils/renice.c +++ b/sys-utils/renice.c @@ -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); diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c index 06f5c383..da8c085f 100644 --- a/sys-utils/rtcwake.c +++ b/sys-utils/rtcwake.c @@ -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 diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c index c43225da..2dfed71a 100644 --- a/sys-utils/switch_root.c +++ b/sys-utils/switch_root.c @@ -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 diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c index 12a725e3..343a86ee 100644 --- a/sys-utils/unshare.c +++ b/sys-utils/unshare.c @@ -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 diff --git a/text-utils/column.c b/text-utils/column.c index 156de705..5c6db257 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -47,12 +47,12 @@ #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)) diff --git a/text-utils/rev.c b/text-utils/rev.c index b6924497..89e5e585 100644 --- a/text-utils/rev.c +++ b/text-utils/rev.c @@ -55,12 +55,12 @@ #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; diff --git a/text-utils/tailf.c b/text-utils/tailf.c index 2dcdba3f..c995d979 100644 --- a/text-utils/tailf.c +++ b/text-utils/tailf.c @@ -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 diff --git a/text-utils/ul.c b/text-utils/ul.c index 30f24e9d..dc0550cc 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -47,12 +47,12 @@ #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 */ |