diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2009-04-09 20:46:39 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2009-04-09 20:46:39 +0000 |
commit | 29fc7923e84b46f29a113b54921d2bf2efacd265 (patch) | |
tree | 702734eedfe25f82eaed50349da9fdc8b7d3ca84 /driver.c | |
parent | 31763af4e114bf6b7b93262ad997566820a5fa9b (diff) | |
download | fetchmail-29fc7923e84b46f29a113b54921d2bf2efacd265.tar.gz fetchmail-29fc7923e84b46f29a113b54921d2bf2efacd265.tar.bz2 fetchmail-29fc7923e84b46f29a113b54921d2bf2efacd265.zip |
Fix pre-/post-connect error/signal reporting.
svn path=/branches/BRANCH_6-3/; revision=5267
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -935,9 +935,13 @@ static int do_session( /* execute pre-initialization command, if any */ if (ctl->preconnect && (err = system(ctl->preconnect))) { - report(stderr, - GT_("pre-connection command failed with status %d\n"), err); - err = PS_SYNTAX; + if (WIFSIGNALED(err)) + report(stderr, + GT_("pre-connection command terminated with signal %d\n"), WTERMSIG(err)); + else + report(stderr, + GT_("pre-connection command failed with status %d\n"), WEXITSTATUS(err)); + err = PS_PROTOCOL; goto closeUp; } @@ -1566,9 +1570,12 @@ closeUp: /* execute wrapup command, if any */ if (ctl->postconnect && (tmperr = system(ctl->postconnect))) { - report(stderr, GT_("post-connection command failed with status %d\n"), tmperr); + if (WIFSIGNALED(tmperr)) + report(stderr, GT_("post-connection command terminated with signal %d\n"), WTERMSIG(tmperr)); + else + report(stderr, GT_("post-connection command failed with status %d\n"), WEXITSTATUS(tmperr)); if (err == PS_SUCCESS) - err = PS_SYNTAX; + err = PS_PROTOCOL; } set_timeout(0); /* cancel any pending alarm */ |