mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-18 11:46:18 -04:00
build: provide replacement for error(3) if not present
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
ea72572364
commit
40ba2786d2
@ -32,7 +32,7 @@ PKG_CHECK_MODULES([FUSE], [fuse3 >= 3.2.1], [AC_DEFINE([HAVE_FUSE], 1, [Define i
|
||||
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
AC_FUNC_MALLOC
|
||||
AC_CHECK_FUNCS([memset strdup])
|
||||
AC_CHECK_FUNCS([error memset strdup])
|
||||
|
||||
AC_CONFIG_FILES([Makefile lib/Makefile])
|
||||
AC_OUTPUT
|
||||
|
18
main.c
18
main.c
@ -36,7 +36,23 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <err.h>
|
||||
#include <error.h>
|
||||
|
||||
#ifdef HAVE_ERROR_H
|
||||
# include <error.h>
|
||||
#else
|
||||
# define error(status, errno, fmt, ...) do { \
|
||||
if (errno == 0) \
|
||||
fprintf (stderr, "crun: " fmt "\n", ##__VA_ARGS__); \
|
||||
else \
|
||||
{ \
|
||||
fprintf (stderr, "crun: " fmt, ##__VA_ARGS__); \
|
||||
fprintf (stderr, ": %s\n", strerror (errno)); \
|
||||
} \
|
||||
if (status) \
|
||||
exit (status); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <fcntl.h>
|
||||
#include <hash.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user