aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-01 14:55:36 -0500
committerMike Frysinger <vapier@gentoo.org>2009-02-01 14:55:36 -0500
commita82b13d844b3362021b90df86c10be6dda72f185 (patch)
tree56621215409d6adacac72333004e969c52f29ee5 /src
parentbuild with --gc-sections by default (diff)
downloadsandbox-a82b13d844b3362021b90df86c10be6dda72f185.tar.gz
sandbox-a82b13d844b3362021b90df86c10be6dda72f185.tar.bz2
sandbox-a82b13d844b3362021b90df86c10be6dda72f185.zip
sandbox: convert remaining perror to sb_pwarn
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/environ.c2
-rw-r--r--src/sandbox.c3
-rw-r--r--src/sandbox.h3
3 files changed, 4 insertions, 4 deletions
diff --git a/src/environ.c b/src/environ.c
index 98dc9b2..94e01b6 100644
--- a/src/environ.c
+++ b/src/environ.c
@@ -235,7 +235,7 @@ static int sb_setenv(char ***envp, const char *name, const char *val)
return 0;
error:
- perror("sandbox: Out of memory (sb_setenv)");
+ sb_pwarn("out of memory");
exit(EXIT_FAILURE);
}
diff --git a/src/sandbox.c b/src/sandbox.c
index ca1f977..d3f582d 100644
--- a/src/sandbox.c
+++ b/src/sandbox.c
@@ -15,9 +15,6 @@
#include "sbutil.h"
#include "sandbox.h"
-#define sb_warn(fmt, args...) fprintf(stderr, "%s" fmt "\n", "sandbox: ", ## args)
-#define sb_pwarn(fmt, args...) sb_warn(fmt ": %s\n", ## args, strerror(errno))
-
static int print_debug = 0;
#define dprintf(fmt, args...) do { if (print_debug) printf(fmt, ## args); } while (0)
#define dputs(str) do { if (print_debug) puts(str); } while (0)
diff --git a/src/sandbox.h b/src/sandbox.h
index a56c2b1..267dc6f 100644
--- a/src/sandbox.h
+++ b/src/sandbox.h
@@ -25,4 +25,7 @@ struct sandbox_info_t {
extern char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive);
+#define sb_warn(fmt, args...) fprintf(stderr, "%s:%s " fmt "\n", "sandbox", __func__, ## args)
+#define sb_pwarn(fmt, args...) sb_warn(fmt ": %s\n", ## args, strerror(errno))
+
#endif