chiark / gitweb /
messages: add some missing newlines
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Jun 2012 23:44:50 +0000 (00:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 19:02:20 +0000 (20:02 +0100)
Message and cfgfatal must be called with a message containing a
newline (or, a newline sent in a later call).  Fix a few call sites.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
log.c
process.c
rsa.c
site.c

diff --git a/log.c b/log.c
index 9cd0572bdebffe76f4c0522e839db4591026cb4f..d940df530e914c2ffba4b0e6f3c5ad0ffd890668 100644 (file)
--- a/log.c
+++ b/log.c
@@ -170,11 +170,11 @@ void cfgfile_postreadcheck(struct cloc loc, FILE *f)
 {
     assert(loc.file);
     if (ferror(f)) {
-       Message(M_FATAL, "error reading config file (%s): %s",
+       Message(M_FATAL, "error reading config file (%s): %s\n",
                loc.file, strerror(errno));
        exit(current_phase);
     } else if (feof(f)) {
-       Message(M_FATAL, "unexpected end of config file (%s)", loc.file);
+       Message(M_FATAL, "unexpected end of config file (%s)\n", loc.file);
        exit(current_phase);
     }
 }
index 0a7a0f262164ab75f8d908bfe2f0181a125ecc05..a9ff3d92648557d7692d9da97fe864c41227a5fe 100644 (file)
--- a/process.c
+++ b/process.c
@@ -152,7 +152,7 @@ int sys_cmd(const char *path, const char *arg, ...)
                        path, arg, WTERMSIG(rv), strsignal(WTERMSIG(rv)),
                        WCOREDUMP(rv) ? " - core dumped" : "");
            else
-               Message(M_ERR, "sys_cmd(%s,%s,...) exited with wstat %#x",
+               Message(M_ERR, "sys_cmd(%s,%s,...) exited with wstat %#x\n",
                        path, arg, rv);
        }
     } else if (c==0) {
diff --git a/rsa.c b/rsa.c
index caa030bd0223656c065a7013775df69523b714f7..0bd106ff3526935734641b239cdb3ec91649de2b 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -194,7 +194,7 @@ static list_t *rsapub_apply(closure_t *self, struct cloc loc, dict_t *context,
     i=list_elem(args,0);
     if (i) {
        if (i->type!=t_string) {
-           cfgfatal(i->loc,"rsa-public","first argument must be a string");
+           cfgfatal(i->loc,"rsa-public","first argument must be a string\n");
        }
        e=i->data.string;
        if (mpz_init_set_str(&st->e,e,10)!=0) {
@@ -208,7 +208,7 @@ static list_t *rsapub_apply(closure_t *self, struct cloc loc, dict_t *context,
     i=list_elem(args,1);
     if (i) {
        if (i->type!=t_string) {
-           cfgfatal(i->loc,"rsa-public","second argument must be a string");
+           cfgfatal(i->loc,"rsa-public","second argument must be a string\n");
        }
        n=i->data.string;
        if (mpz_init_set_str(&st->n,n,10)!=0) {
@@ -267,7 +267,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context,
     i=list_elem(args,0);
     if (i) {
        if (i->type!=t_string) {
-           cfgfatal(i->loc,"rsa-public","first argument must be a string");
+           cfgfatal(i->loc,"rsa-public","first argument must be a string\n");
        }
        filename=i->data.string;
     } else {
@@ -313,7 +313,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context,
     }
     b=safe_malloc(length,"rsapriv_apply");
     if (fread(b,length,1,f) != 1) {
-       cfgfatal_maybefile(f,loc,"rsa-private","error reading modulus");
+       cfgfatal_maybefile(f,loc,"rsa-private","error reading modulus\n");
     }
     mpz_init(&st->n);
     read_mpbin(&st->n,b,length);
diff --git a/site.c b/site.c
index 0cd364b8135e963c7b923a684836baec2ccc1294..b54b34e4200a0c52d8f777fa69f41123475eef96 100644 (file)
--- a/site.c
+++ b/site.c
@@ -1342,15 +1342,16 @@ static list_t *site_apply(closure_t *self, struct cloc loc, dict_t *context,
     st->netlink=find_cl_if(dict,"link",CL_NETLINK,True,"site",loc);
 
     list_t *comms_cfg=dict_lookup(dict,"comm");
-    if (!comms_cfg) cfgfatal(loc,"site","closure list \"comm\" not found");
+    if (!comms_cfg) cfgfatal(loc,"site","closure list \"comm\" not found\n");
     st->ncomms=list_length(comms_cfg);
     st->comms=safe_malloc_ary(sizeof(*st->comms),st->ncomms,"comms");
     assert(st->ncomms);
     for (i=0; i<st->ncomms; i++) {
        item_t *item=list_elem(comms_cfg,i);
-       if (item->type!=t_closure) cfgfatal(loc,"site","comm is not a closure");
+       if (item->type!=t_closure)
+           cfgfatal(loc,"site","comm is not a closure\n");
        closure_t *cl=item->data.closure;
-       if (cl->type!=CL_COMM) cfgfatal(loc,"site","comm closure wrong type");
+       if (cl->type!=CL_COMM) cfgfatal(loc,"site","comm closure wrong type\n");
        st->comms[i]=cl->interface;
     }