diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-07 19:48:42 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-07 19:48:42 +0800 |
commit | e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2 (patch) | |
tree | 6917e3ead4beec72534673b799b5e51add0a0519 /mbbsd/mbbsd.c | |
parent | f596ac6e290311dea6c2181816b7d096127696a8 (diff) | |
download | pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.tar pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.tar.gz pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.tar.bz2 pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.tar.lz pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.tar.xz pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.tar.zst pttbbs-e67dbfb410cb519dbd4ae3e0f3cd12aef46e48f2.zip |
use open() instead of fopen() in log_file()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1405 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 028a91b6..1b932dad 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -99,11 +99,12 @@ reapchild(int sig) void log_user(char *msg) { - char filename[200]; + char filename[200], buf[200]; snprintf(filename, sizeof(filename), BBSHOME "/home/%c/%s/USERLOG", cuser.userid[0], cuser.userid); - log_file(filename, msg); + snprintf(buf, sizeof(buf), "%s\n", msg); + log_file(filename, msg, 1); } @@ -115,14 +116,14 @@ log_usies(char *mode, char *mesg) if (!mesg) snprintf(genbuf, sizeof(genbuf), cuser.userid[0] ? "%s %s %-12s Stay:%d (%s)" : - "%s %s %s Stay:%d (%s)", + "%s %s %s Stay:%d (%s)\n", Cdate(&now), mode, cuser.userid, (int)(now - login_start_time) / 60, cuser.username); else snprintf(genbuf, sizeof(genbuf), - cuser.userid[0] ? "%s %s %-12s %s" : "%s %s %s%s", + cuser.userid[0] ? "%s %s %-12s %s" : "%s %s %s%s\n", Cdate(&now), mode, cuser.userid, mesg); - log_file(FN_USIES, genbuf); + log_file(FN_USIES, genbuf, 1); /* °lÂÜ¨Ï¥ÎªÌ */ if (HAS_PERM(PERM_LOGUSER)) |