split imap4d_bye() into imap4d_bye() and imap4d_bye().
Showing
1 changed file
with
11 additions
and
0 deletions
... | @@ -21,6 +21,12 @@ | ... | @@ -21,6 +21,12 @@ |
21 | int | 21 | int |
22 | imap4d_bye (int reason) | 22 | imap4d_bye (int reason) |
23 | { | 23 | { |
24 | return imap4d_bye0 (reason, NULL); | ||
25 | } | ||
26 | |||
27 | int | ||
28 | imap4d_bye0 (int reason, struct imap4d_command *command) | ||
29 | { | ||
24 | struct passwd *pw = getpwuid (getuid ()); | 30 | struct passwd *pw = getpwuid (getuid ()); |
25 | const char *username; | 31 | const char *username; |
26 | int status = EXIT_FAILURE; | 32 | int status = EXIT_FAILURE; |
... | @@ -41,6 +47,7 @@ imap4d_bye (int reason) | ... | @@ -41,6 +47,7 @@ imap4d_bye (int reason) |
41 | break; | 47 | break; |
42 | 48 | ||
43 | case ERR_SIGNAL: | 49 | case ERR_SIGNAL: |
50 | if (ofile) | ||
44 | util_out (RESP_BYE, "Quitting on signal"); | 51 | util_out (RESP_BYE, "Quitting on signal"); |
45 | syslog (LOG_ERR, "Quitting on signal"); | 52 | syslog (LOG_ERR, "Quitting on signal"); |
46 | break; | 53 | break; |
... | @@ -72,6 +79,10 @@ imap4d_bye (int reason) | ... | @@ -72,6 +79,10 @@ imap4d_bye (int reason) |
72 | break; | 79 | break; |
73 | } | 80 | } |
74 | 81 | ||
82 | if (status == EXIT_SUCCESS && command) | ||
83 | util_finish (command, RESP_OK, "Completed"); | ||
75 | closelog (); | 84 | closelog (); |
76 | exit (status); | 85 | exit (status); |
77 | } | 86 | } |
87 | |||
88 | ... | ... |
-
Please register or sign in to post a comment