# HG changeset patch # User Mikael Berthe # Date 1138313657 -3600 # Node ID 80d4959422caa3e0460f14d08ad364fcb93a2976 # Parent ae7016aae01403ee8168e0aa8657b4bcf671017a New "eventcmd_checkstatus" option diff -r ae7016aae014 -r 80d4959422ca mcabber/mcabberrc.example --- 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: diff -r ae7016aae014 -r 80d4959422ca mcabber/src/main.c --- 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);