aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fetchmail.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 69a137e5..3b06594d 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -832,7 +832,16 @@ int main(int argc, char **argv)
successes ? PS_SUCCESS : querystatus);
terminate_run(0);
- exit(successes ? PS_SUCCESS : querystatus);
+
+ if (successes)
+ exit(PS_SUCCESS);
+ else if (querystatus)
+ exit(querystatus);
+ else
+ /* in case we interrupted before a successful fetch */
+ exit(PS_NOMAIL);
+
+ exit(successes ? : querystatus);
}
static void list_merge(struct idlist **dstl, struct idlist **srcl, int force)