diff --git a/bwrap-oci.c b/bwrap-oci.c index a37fea1..1686b0d 100644 --- a/bwrap-oci.c +++ b/bwrap-oci.c @@ -19,7 +19,9 @@ #include #include #include +#ifdef HAVE_ERROR_H #include +#endif #include #include #include diff --git a/configure.ac b/configure.ac index db26633..9b37286 100644 --- a/configure.ac +++ b/configure.ac @@ -18,10 +18,32 @@ PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0]) PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0]) AC_CHECK_LIB(seccomp, seccomp_rule_add) +AC_CHECK_HEADERS([error.h]) + AC_PATH_PROG(BWRAP, [bwrap]) AC_DEFINE_UNQUOTED([BWRAP], ["$BWRAP"], [Path to bwrap]) AC_CONFIG_FILES([ Makefile ]) + +AH_BOTTOM([ +#ifndef HAVE_ERROR_H +#ifndef _ERROR_LOCAL +#define _ERROR_LOCAL 1 +#include +#include +#include + +static void error(int status, int errnum, const char *msg, ...) { + if (errnum) + fprintf(stderr, ": %s\n", strerror(errnum)); + else + fputc('\n', stderr); + if (status) + exit(status); +} +#endif +#endif +]) AC_OUTPUT diff --git a/kill.c b/kill.c index c180098..03527ce 100644 --- a/kill.c +++ b/kill.c @@ -19,7 +19,9 @@ #include #include "util.h" #include "kill.h" +#ifdef HAVE_ERROR_H #include +#endif #include #include diff --git a/list.c b/list.c index f0260ec..6b216a1 100644 --- a/list.c +++ b/list.c @@ -19,7 +19,9 @@ #include #include #include +#ifdef HAVE_ERROR_H #include +#endif #include #include #include diff --git a/run.c b/run.c index 1407299..d81bb51 100644 --- a/run.c +++ b/run.c @@ -19,7 +19,9 @@ #include #include #include +#ifdef HAVE_ERROR_H #include +#endif #include #include #include diff --git a/util.c b/util.c index 8f3a1d4..b56d5ec 100644 --- a/util.c +++ b/util.c @@ -20,7 +20,9 @@ #include "util.h" #include #include +#ifdef HAVE_ERROR_H #include +#endif #include #include #include @@ -359,7 +361,7 @@ get_bundle_path (const char *rootfs) { gchar *ret; cleanup_free gchar *tmp = g_strdup (rootfs); - ret = canonicalize_file_name(dirname (tmp)); + ret = realpath(dirname (tmp), NULL); return ret; }