Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
config: backup - handle correctly spawnv return code
  • Loading branch information
perexg committed Jan 17, 2015
1 parent dafea1a commit 3dba7bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/config.c
Expand Up @@ -1211,10 +1211,12 @@ dobackup(const char *oldver)
root, oldver);
tvhinfo("config", "backup: running, output file %s", outfile);

spawnv(argv[0], (void *)argv, NULL, 1, 1);

while ((code = spawn_reap(errtxt, sizeof(errtxt))) == -EAGAIN)
usleep(20000);
if (spawnv(argv[0], (void *)argv, NULL, 1, 1)) {
code = -ENOENT;
} else {
while ((code = spawn_reap(errtxt, sizeof(errtxt))) == -EAGAIN)
usleep(20000);
}

if (code) {
htsbuf_queue_t q;
Expand Down

0 comments on commit 3dba7bf

Please sign in to comment.