diff --git a/include/proto.h b/include/proto.h index d81dbf504..f7e6ee565 100644 --- a/include/proto.h +++ b/include/proto.h @@ -75,6 +75,7 @@ void brd_edit(int bno); int a_editbrd(void); int u_verify(void); /* bbsd.c */ +void blog_pid(const char *mode, const char *msg, pid_t pid); void blog(const char *mode, const char *msg); void u_exit(const char *mode); GCC_NORETURN void abort_bbs(void); diff --git a/maple/bbsd.c b/maple/bbsd.c index b25a3357e..5cdb1e10c 100644 --- a/maple/bbsd.c +++ b/maple/bbsd.c @@ -52,9 +52,10 @@ int treat=0; /* ----------------------------------------------------- */ void -blog( +blog_pid( const char *mode, - const char *msg + const char *msg, + pid_t pid ) { char buf[512], data[256]; @@ -64,13 +65,22 @@ blog( if (!msg) { msg = data; - sprintf(data, "Stay: %d (%d)", (int)(now - ap_start) / 60, currpid); + sprintf(data, "Stay: %d (%d)", (int)(now - ap_start) / 60, pid); } sprintf(buf, "%s %-5.5s %-13s%s\n", Etime(&now), mode, cuser.userid, msg); f_cat(FN_USIES, buf); } +void +blog( + const char *mode, + const char *msg +) +{ + blog_pid(mode, msg, currpid); +} + #ifdef MODE_STAT void @@ -718,7 +728,7 @@ tn_login(void) if (vans("偵測到多重登入,您想刪除其他重複的 login (Y/n)嗎?[Y] ") != 'n') { kill(pid, SIGTERM); - blog("MULTI", cuser.username); + blog_pid("MULTI", cuser.username, pid); break; }