From f5355ecf7bed105d527fdab34644c808eb91749b Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 18 Jul 2015 15:36:06 +0200 Subject: [PATCH] lite.h: Convert from error.h to the more BSD friendly err.h OpenBSD, and possibly the other BSD's, do not have error.h so we replace it with err.h, which exists almost everywhere. This means the macros in lite.h that used error() now instead use warn(), with the same semantics as before. Signed-off-by: Joachim Nilsson --- lite.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lite.h b/lite.h index bad9623..e1661e9 100644 --- a/lite.h +++ b/lite.h @@ -25,7 +25,7 @@ #ifndef FINIT_LITE_H_ #define FINIT_LITE_H_ -#include +#include #include #include /* uint8_t, uint16_t, uint32_t, INT32_MAX, etc. */ #include @@ -70,16 +70,16 @@ long long strtonum (const char *numstr, long long minval, long long maxval, cons #endif #ifndef touch -# define touch(x) do { if (mknod((x), S_IFREG|0644, 0) && errno != EEXIST) error(0, errno, "Failed creating %s", x); } while (0) +# define touch(x) do { if (mknod((x), S_IFREG|0644, 0) && errno != EEXIST) warn("Failed creating %s", x); } while (0) #endif #ifndef makedir -# define makedir(x, p) do { if (mkdir(x, p) && errno != EEXIST) error(0, errno, "Failed creating directory %s", x); } while (0) +# define makedir(x, p) do { if (mkdir(x, p) && errno != EEXIST) warn("Failed creating directory %s", x); } while (0) #endif #ifndef makefifo -# define makefifo(x, p) do { if (mkfifo(x, p) && errno != EEXIST) error(0, errno, "Failed creating FIFO %s", x); } while (0) +# define makefifo(x, p) do { if (mkfifo(x, p) && errno != EEXIST) warn("Failed creating FIFO %s", x); } while (0) #endif #ifndef erase -# define erase(x) do { if (remove(x) && errno != ENOENT) error(0, errno, "Failed removing %s", x); } while (0) +# define erase(x) do { if (remove(x) && errno != ENOENT) warn("Failed removing %s", x); } while (0) #endif #ifndef chardev # define chardev(x,m,maj,min) mknod((x), S_IFCHR|(m), makedev((maj),(min)))