From a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:52:39 +0200 Subject: format files --- src/qmail-badmimetypes.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/qmail-badmimetypes.c') diff --git a/src/qmail-badmimetypes.c b/src/qmail-badmimetypes.c index a75ad4c..d56854e 100644 --- a/src/qmail-badmimetypes.c +++ b/src/qmail-badmimetypes.c @@ -1,26 +1,28 @@ -#include #include -#include "logmsg.h" -#include "stralloc.h" +#include + #include "buffer.h" -#include "getln.h" +#include "cdbmake.h" #include "exit.h" +#include "getln.h" +#include "logmsg.h" #include "open.h" +#include "stralloc.h" + #include "auto_qmail.h" -#include "cdbmake.h" -#define WHO "qmail-badmimetypes" +#define WHO "qmail-badmimetypes" #define MIMETYPE_LEN 9 -int rename(const char *,const char *); // stdio.h +int rename(const char *, const char *); // stdio.h void die_read() { - logmsg(WHO,111,FATAL,"unable to read control/badmimetypes"); + logmsg(WHO, 111, FATAL, "unable to read control/badmimetypes"); } void die_write() { - logmsg(WHO,111,FATAL,"unable to write to control/badmimetypes.tmp"); + logmsg(WHO, 111, FATAL, "unable to write to control/badmimetypes.tmp"); } char inbuf[1024]; @@ -36,32 +38,30 @@ int match; int main() { umask(033); - if (chdir(auto_qmail) == -1) - logmsg(WHO,111,FATAL,B("unable to chdir to: ",auto_qmail)); + if (chdir(auto_qmail) == -1) logmsg(WHO, 111, FATAL, B("unable to chdir to: ", auto_qmail)); fd = open_read("control/badmimetypes"); if (fd == -1) die_read(); - buffer_init(&b,read,fd,inbuf,sizeof(inbuf)); + buffer_init(&b, read, fd, inbuf, sizeof(inbuf)); fdtemp = open_trunc("control/badmimetypes.tmp"); if (fdtemp == -1) die_write(); - if (cdb_make_start(&cdb,fdtemp) == -1) die_write(); + if (cdb_make_start(&cdb, fdtemp) == -1) die_write(); for (;;) { - if (getln(&b,&line,&match,'\n') != 0) die_read(); + if (getln(&b, &line, &match, '\n') != 0) die_read(); if (line.s[0] != '#' && line.len > MIMETYPE_LEN) - if (cdb_make_add(&cdb,line.s,MIMETYPE_LEN,"",0) == -1) - die_write(); + if (cdb_make_add(&cdb, line.s, MIMETYPE_LEN, "", 0) == -1) die_write(); if (!match) break; } if (cdb_make_finish(&cdb) == -1) die_write(); if (fsync(fdtemp) == -1) die_write(); if (close(fdtemp) == -1) die_write(); /* NFS stupidity */ - if (rename("control/badmimetypes.tmp","control/badmimetypes.cdb") == -1) - logmsg(WHO,111,FATAL,"unable to move control/badmimetypes.tmp to control/badmimetypes.cdb"); + if (rename("control/badmimetypes.tmp", "control/badmimetypes.cdb") == -1) + logmsg(WHO, 111, FATAL, "unable to move control/badmimetypes.tmp to control/badmimetypes.cdb"); _exit(0); } -- cgit v1.2.3