| Newsgroups |
gmane.network.sn |
| Message-ID |
<3698.384c7817.64565@felicity> |
A very silly bug, and some log level butchering.
-harold
Index: snsend.c
===================================================================
RCS file: /var/home/harold/repository/sn/snsend.c,v
retrieving revision 1.4
diff -u -r1.4 snsend.c
--- snsend.c 1999/10/24 16:40:17 1.4
+++ snsend.c 1999/12/07 02:35:47
@@ -53,6 +53,7 @@
static int pid;
static struct timeval now;
static int canalias = 1;
+static int report = 0;
int debug = 0;
static ng_t
@@ -109,13 +110,12 @@
strcpy(path2, path1);
*strrchr(path2, '+') = '$';
if( -1 == link(path1, path2) && EEXIST != errno ){
- er = -1; log("store_global:link(%s,%s):%m"); }
+ er = -1; log("store_global:link(%s,%s):%m", path1, path2); }
}else
log("store_global:write(%s):%m", path1);
(void)unlink(path1);
if( er )_exit(2);
- LOG1("store_global:returning ok");
return(0);
}
@@ -145,6 +145,8 @@
log("store_local:can't insert in db for \"%s\" in %s:%d, %m?",
messageid, group, d.serial);
}
+ if( report )
+ writef(1, "%s %u <%s>\n", group?group:JUNK_GROUP, d.serial, messageid);
return(group?d.serial:0);
}
@@ -173,11 +175,11 @@
if( WIFEXITED(s) ){
if( 0 == WEXITSTATUS(s) )return(0);
s = WEXITSTATUS(s);
- fail(s, "%s/.outgoing exited with %d", s);
+ fail(s, "%s/.outgoing exited with %d", s, s);
}
if( WIFSIGNALED(s) )
fail(WTERMSIG(s)+128, "%s/.outgoing caught signal %d", WTERMSIG(s));
- fail(9, "%s/.outgoing unknown wait status %d", s);
+ fail(9, "%s/.outgoing unknown wait status %d", group, s);
_exit(1); /* dumb compiler */
}
static int store_special(char * group) { return(special(group, 0)); }
@@ -239,7 +241,6 @@
}else
have_junk_group = 1;
}
-static int report = 0;
static void
snsend(void)
@@ -571,7 +572,7 @@
appendhead("!", 1);
appendhead(path.buf, path.used);
}else
- LOG1("created Path header...");
+ LOG3("created Path header...");
appendhead("\r\n", 2);
appendhead(htmp.buf, htmp.used);
@@ -584,9 +585,9 @@
appendhead("Message-ID: <", sizeof("Message-ID: <")-1);
appendhead(buf, c);
appendhead(">\r\n", 3);
- LOG1("created message ID \"%s\"", buf);
+ LOG3("created message ID \"%s\"", buf);
}else
- LOG1("read article \"%s\"", msgid.buf);
+ LOG3("read article \"%s\"", msgid.buf);
messageid = msgid.buf;
/* Date. strftime(3) uses locale, we don't want that. */
@@ -612,7 +613,7 @@
appendhead("Date: ", sizeof("Date: ")-1);
appendhead(p, strlen(p));
appendhead(" GMT\r\n", 6);
- LOG1("added Date to article \"%s\"", messageid);
+ LOG3("added Date to article \"%s\"", messageid);
}
if( 0 == body_lines ){