Add - Pause and retry popen on failure

Signed-off-by: rob <rob@blue-wave.net>
This commit is contained in:
rob
2021-05-10 07:52:22 +01:00
parent 20d20f3519
commit 01a9472f1e

View File

@@ -144,9 +144,15 @@ static int _execute_ret(char* msg, int msg_len, const char *cmd)
fp = popen(cmd, "r");
if (fp == NULL) {
debug(LOG_ERR, "popen(): %s", strerror(errno));
rc = -1;
goto abort;
debug(LOG_ERR, "popen(): [%s] Retrying..", strerror(errno));
sleep(1);
fp = popen(cmd, "r");
if (fp == NULL) {
debug(LOG_ERR, "popen(): [%s] Giving up..", strerror(errno));
rc = -1;
goto abort;
}
}
if (msg && msg_len > 0) {