Module: kamailio
Branch: master
Commit: e9eee1ead964992a2d81014709755bbfd1e995c9
URL:
https://github.com/kamailio/kamailio/commit/e9eee1ead964992a2d81014709755bb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-11-03T12:49:33+01:00
exec: debug message when command returns non-zero
---
Modified: src/modules/exec/exec.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e9eee1ead964992a2d81014709755bb…
Patch:
https://github.com/kamailio/kamailio/commit/e9eee1ead964992a2d81014709755bb…
---
diff --git a/src/modules/exec/exec.c b/src/modules/exec/exec.c
index 0e809ed8af..763e30816e 100644
--- a/src/modules/exec/exec.c
+++ b/src/modules/exec/exec.c
@@ -326,11 +326,17 @@ int exec_cmd(sip_msg_t *msg, char *cmd)
exit_status = pclose(pipe);
if(WIFEXITED(exit_status)) { /* exited properly .... */
/* return false if script exited with non-zero status */
- if(WEXITSTATUS(exit_status) != 0)
+ if(WEXITSTATUS(exit_status) != 0) {
+ LM_DBG("cmd %s with non-zero status - exit_status=%d,"
+ " wexitstatus: %d, errno=%d: %s\n",
+ cmd, exit_status, WEXITSTATUS(exit_status),
+ errno, strerror(errno));
ret = -1;
+ }
} else { /* exited erroneously */
- LM_ERR("cmd %s failed. exit_status=%d, errno=%d: %s\n", cmd,
- exit_status, errno, strerror(errno));
+ LM_ERR("cmd %s failed. exit_status=%d, wexitstatus: %d, errno=%d: %s\n",
+ cmd, exit_status, WEXITSTATUS(exit_status),
+ errno, strerror(errno));
ret = -1;
}