diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-08-23 16:23:17 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-24 00:18:53 +0200 |
| commit | 6bd2b3608d6dc1eca171c30916f029f6f867db6b (patch) | |
| tree | c17023a6b603cc8c30dce20e8342b7667f260cd3 /lib/libfrr.c | |
| parent | 9eed278b163d2175ee714869085a54f2c3726cca (diff) | |
lib: fix cosmetic issue with exit race
if we're using --terminal, the daemon may in some cases exit fast enough
for the parent to see this; this resulted in a confusing/bogus "failed
to start, exited 0" message.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index c3ef04c673..9944fdd1e1 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -641,7 +641,10 @@ static void frr_daemon_wait(int fd) exit(0); /* child failed one way or another ... */ - if (WIFEXITED(exitstat)) + if (WIFEXITED(exitstat) && WEXITSTATUS(exitstat) == 0) + /* can happen in --terminal case if exit is fast enough */ + (void)0; + else if (WIFEXITED(exitstat)) fprintf(stderr, "%s failed to start, exited %d\n", di->name, WEXITSTATUS(exitstat)); else if (WIFSIGNALED(exitstat)) |
