]> code.delx.au - pulseaudio/blobdiff - src/pulse/mainloop-signal.c
proplist: Return early from pa_proplist_equal() if the pointers are equal.
[pulseaudio] / src / pulse / mainloop-signal.c
index 91c6bf6db48ada8f756254a38341bac91e2dbfc1..3dc74398182bf5ffbbda2b526aa55cf475a39f17 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of PulseAudio.
 
@@ -8,7 +6,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2 of the License,
+  by the Free Software Foundation; either version 2.1 of the License,
   or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -40,6 +38,7 @@
 
 #include <pulse/xmalloc.h>
 #include <pulse/gccmacro.h>
+#include <pulse/i18n.h>
 
 #include <pulsecore/core-error.h>
 #include <pulsecore/core-util.h>
@@ -91,7 +90,7 @@ static void dispatch(pa_mainloop_api*a, int sig) {
         }
 }
 
-static void callback(pa_mainloop_api*a, pa_io_event*e, int fd, pa_io_event_flags_t f, PA_GCC_UNUSED void *userdata) {
+static void callback(pa_mainloop_api*a, pa_io_event*e, int fd, pa_io_event_flags_t f, void *userdata) {
     ssize_t r;
     int sig;
 
@@ -167,9 +166,11 @@ pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t _callback, void *userdata
     pa_assert(sig > 0);
     pa_assert(_callback);
 
+    pa_init_i18n();
+
     for (e = signals; e; e = e->next)
         if (e->sig == sig)
-            goto fail;
+            return NULL;
 
     e = pa_xnew(pa_signal_event, 1);
     e->sig = sig;
@@ -195,8 +196,7 @@ pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t _callback, void *userdata
 
     return e;
 fail:
-    if (e)
-        pa_xfree(e);
+    pa_xfree(e);
     return NULL;
 }