applet: print strerror and exit if execlp() fails
[espeaktime] / src / applet.c
index a0fae5b..9659081 100644 (file)
@@ -1,4 +1,5 @@
 #include <unistd.h>
 #include <unistd.h>
+#include <errno.h>
 #include <gtk/gtk.h>
 #include <hildon/hildon.h>
 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
 #include <gtk/gtk.h>
 #include <hildon/hildon.h>
 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
@@ -158,7 +159,8 @@ static void cfg_speak(struct espeaktime_settings *cfg, gboolean test_mode)
        res = execlp(ESPEAK_BIN, ESPEAK_BIN,
                "-a", astr, "-p", pstr, "-s", sstr, "-v", vstr,
                text, NULL);
        res = execlp(ESPEAK_BIN, ESPEAK_BIN,
                "-a", astr, "-p", pstr, "-s", sstr, "-v", vstr,
                text, NULL);
-       g_print("execlp: %d\n", res);
+       g_print("execlp: %d (%s)\n", res, g_strerror(errno));
+       exit(res);
 }
 
 
 }