summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-18 11:11:05 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-18 11:11:05 +0000
commitf7fb4d9e3ef80309926b51977da04572960054df (patch)
tree44c99a747a142ddeff9d52749490d8aa7970d749
parentfe459110b6b3fe5fd4c60bb28c9f9b91a37d95c6 (diff)
downloadrspamd-f7fb4d9e3ef80309926b51977da04572960054df.tar.gz
rspamd-f7fb4d9e3ef80309926b51977da04572960054df.zip
Add workaround for old glib
-rw-r--r--src/rspamadm/signtool.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rspamadm/signtool.c b/src/rspamadm/signtool.c
index 9b19e1b65..998698622 100644
--- a/src/rspamadm/signtool.c
+++ b/src/rspamadm/signtool.c
@@ -23,6 +23,9 @@
#include "libutil/str_util.h"
#include "libutil/util.h"
#include "unix-std.h"
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
static gboolean openssl = FALSE;
static gboolean verify = FALSE;
@@ -188,12 +191,21 @@ rspamadm_edit_file (const gchar *fname)
}
}
+#if GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 34
if (!g_spawn_check_exit_status (retcode, &err)) {
unlink (tmppath);
rspamd_fprintf (stderr, "%s returned error code: %d - %e\n", editor,
retcode, err);
exit (retcode);
}
+#else
+ if (retcode != 0) {
+ unlink (tmppath);
+ rspamd_fprintf (stderr, "%s returned error code: %d\n", editor,
+ retcode);
+ exit (retcode);
+ }
+#endif
map = rspamd_file_xmap (tmppath, PROT_READ, &len);