mirror of
https://github.com/openNDS/openNDS.git
synced 2026-05-04 03:01:32 -04:00
Add - Pause and retry popen on failure
Signed-off-by: rob <rob@blue-wave.net>
This commit is contained in:
12
src/util.c
12
src/util.c
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user