summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-11 12:05:17 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-11 12:05:17 +0200
commit4848354bb90360e8895e15bb5ca74913155c4bcc (patch)
tree4e7e5d1beb35033cf21761924cee0295e4501a2d
parent8028c7fa47642b452038176004bea3a8966811ac (diff)
downloadxK-4848354bb90360e8895e15bb5ca74913155c4bcc.tar.gz
xK-4848354bb90360e8895e15bb5ca74913155c4bcc.tar.xz
xK-4848354bb90360e8895e15bb5ca74913155c4bcc.zip
Get rid of the remaining FAILs
-rw-r--r--common.c7
-rw-r--r--zyklonb.c10
2 files changed, 8 insertions, 9 deletions
diff --git a/common.c b/common.c
index 4bbebd9..347e82b 100644
--- a/common.c
+++ b/common.c
@@ -34,13 +34,6 @@
#include <arpa/inet.h>
#include <netinet/tcp.h>
-/// Shorthand to set an error and return failure from the function
-#define FAIL(...) \
- BLOCK_START \
- error_set (e, __VA_ARGS__); \
- return 0; \
- BLOCK_END
-
// --- To be moved to liberty --------------------------------------------------
static ssize_t
diff --git a/zyklonb.c b/zyklonb.c
index 53cb6f3..5f73105 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -1028,11 +1028,17 @@ plugin_launch (struct bot_context *ctx, const char *name, struct error **e)
{
const char *plugin_dir = str_map_find (&ctx->config, "plugin_dir");
if (!plugin_dir)
- FAIL ("plugin directory not set");
+ {
+ error_set (e, "plugin directory not set");
+ return NULL;
+ }
int stdin_pipe[2];
if (pipe (stdin_pipe) == -1)
- FAIL ("%s: %s", "pipe", strerror (errno));
+ {
+ error_set (e, "%s: %s", "pipe", strerror (errno));
+ return NULL;
+ }
int stdout_pipe[2];
if (pipe (stdout_pipe) == -1)