--- a/mcabber/mcabberrc.example Wed Jan 25 22:00:06 2006 +0100
+++ b/mcabber/mcabberrc.example Thu Jan 26 23:14:17 2006 +0100
@@ -97,6 +97,12 @@
#set event_log_files = 0
#set event_log_dir = /home/mikael/.mcabber/event_files
+# External command status check
+# You can request mcabber to inspect exit status value after each
+# events_command. If this option is set, mcabber will beep if the
+# exit value is 2.
+#set eventcmd_checkstatus = 0
+
# Traces logging
# If you want advanced traces, please specify a file and a level here.
# There are currently 2 traceloglog levels:
--- a/mcabber/src/main.c Wed Jan 25 22:00:06 2006 +0100
+++ b/mcabber/src/main.c Thu Jan 26 23:14:17 2006 +0100
@@ -122,6 +122,15 @@
pid_t pid;
do {
pid = waitpid (WAIT_ANY, &status, WNOHANG);
+ // Check the exit status value if 'eventcmd_checkstatus' is set
+ if (settings_opt_get_int("eventcmd_checkstatus")) {
+ if (pid > 0) {
+ // exit status 2 -> beep
+ if (WIFEXITED(status) && WEXITSTATUS(status) == 2) {
+ scr_Beep();
+ }
+ }
+ }
} while (pid > 0);
//if (pid < 0)
// scr_LogPrint(LPRINT_LOGNORM, "Error in waitpid: errno=%d", errno);