aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-28 17:27:47 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-28 17:27:47 +0400
commit3fe671c49e5f3fc4798c67a57a2089bdfc6bc530 (patch)
treede93cb7fd4887663bcdf3453425d86a507a08434
parentf10534112b1ad2c0ab8b0893eab3a1e15dedb506 (diff)
downloadrspamd-3fe671c49e5f3fc4798c67a57a2089bdfc6bc530.tar.gz
rspamd-3fe671c49e5f3fc4798c67a57a2089bdfc6bc530.zip
Add compatibility with glib < 2.2.22
Fix user in start script
-rwxr-xr-xfreebsd/rspamd.sh.in6
-rw-r--r--src/util.c7
-rw-r--r--src/util.h3
3 files changed, 13 insertions, 3 deletions
diff --git a/freebsd/rspamd.sh.in b/freebsd/rspamd.sh.in
index 4716753d8..c527a6d1d 100755
--- a/freebsd/rspamd.sh.in
+++ b/freebsd/rspamd.sh.in
@@ -25,8 +25,8 @@ load_rc_config $name
: ${rspamd_enable="NO"}
: ${rspamd_pidfile="/var/run/rspamd/rspamd.pid"}
-: ${rspamd_user="@RSPAMD_USER@"}
-: ${rspamd_group="@RSPAMD_GROUP@"}
+: ${rspamd_run_user="@RSPAMD_USER@"}
+: ${rspamd_run_group="@RSPAMD_GROUP@"}
pidfile="$rspamd_pidfile"
@@ -47,6 +47,6 @@ extra_commands="reload configtest reopenlog"
sig_reload="HUP"
command="$procname"
-command_args="-u ${rspamd_user} -g ${rspamd_group} -c @CMAKE_INSTALL_PREFIX@/etc/rspamd.xml"
+command_args="-u ${rspamd_run_user} -g ${rspamd_run_group} -c @CMAKE_INSTALL_PREFIX@/etc/rspamd.xml"
run_rc_command "$1"
diff --git a/src/util.c b/src/util.c
index 8c640bc68..df0e444c3 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1551,6 +1551,13 @@ rspamd_sprintf_num (gchar *buf, gchar *last, guint64 ui64, gchar zero,
return ((gchar *)memcpy (buf, p, len)) + len;
}
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MICRO_VERSION == 2) && (GLIB_MINOR_VERSION < 22))
+void
+g_ptr_array_unref (GPtrArray *array)
+{
+ g_ptr_array_free (array, TRUE);
+}
+#endif
/*
* vi:ts=4
diff --git a/src/util.h b/src/util.h
index 403d3447e..de5df239a 100644
--- a/src/util.h
+++ b/src/util.h
@@ -87,6 +87,9 @@ stat_file_t* get_statfile_by_symbol (statfile_pool_t *pool, struct classifier_co
const gchar *symbol, struct statfile **st, gboolean try_create);
#endif
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MICRO_VERSION == 2) && (GLIB_MINOR_VERSION < 22))
+void g_ptr_array_unref (GPtrArray *array);
+#endif
/*
* supported formats:
* %[0][width][x][X]O off_t