From: Vsevolod Stakhov Date: Thu, 28 Oct 2010 13:27:47 +0000 (+0400) Subject: Add compatibility with glib < 2.2.22 X-Git-Tag: 0.3.3~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3fe671c49e5f3fc4798c67a57a2089bdfc6bc530;p=rspamd.git Add compatibility with glib < 2.2.22 Fix user in start script --- 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