diff options
Diffstat (limited to 'src/qmail-clean.c')
-rw-r--r-- | src/qmail-clean.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/qmail-clean.c b/src/qmail-clean.c index 2a9d706..efeda8c 100644 --- a/src/qmail-clean.c +++ b/src/qmail-clean.c @@ -70,9 +70,9 @@ int main() cleanuploop = 0; for (;;) { - if (cleanuploop) + if (cleanuploop) { --cleanuploop; - else { + } else { cleanuppid(); cleanuploop = 30; } @@ -98,28 +98,31 @@ int main() continue; } } - if (line.s[i] == '/') - if (!scan_ulong(line.s + i + 1, &id)) { - respond("x"); - continue; - } - if (byte_equal(line.s, 5, "foop/")) { -#define U(prefix, flag) \ - fmtqfn(fnbuf, prefix, id, flag); \ - if (unlink(fnbuf) == -1) \ - if (errno != ENOENT) { \ - respond("!"); \ - continue; \ + if (line.s[i] == '/' && !scan_ulong(line.s + i + 1, &id)) { + respond("x"); + continue; } - U("intd/", 1) - U("mess/", 1) +#define U(prefix, flag) \ + do { \ + fmtqfn(fnbuf, prefix, id, flag); \ + if (unlink(fnbuf) == -1) \ + if (errno != ENOENT) { \ + respond("!"); \ + continue; \ + } \ + } while (0) + + if (byte_equal(line.s, 5, "foop/")) { + U("intd/", 1); + U("mess/", 1); respond("+"); } else if (byte_equal(line.s, 4, "todo/")) { - U("intd/", 1) - U("todo/", 1) + U("intd/", 1); + U("todo/", 1); respond("+"); - } else + } else { respond("x"); + } } _exit(0); } |