summaryrefslogtreecommitdiffstats
path: root/util/xchatd.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-24 22:06:48 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-24 22:06:48 +0800
commit9084d9602e8725a6fb832d4396c12ddd7bb2b7c7 (patch)
tree78d04dab42a50e73845c8e31eb877001fb8379cd /util/xchatd.c
parentf6324fdcb56a70815842cc39cb1826ce6b82148c (diff)
downloadpttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar
pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.gz
pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.bz2
pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.lz
pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.xz
pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.tar.zst
pttbbs-9084d9602e8725a6fb832d4396c12ddd7bb2b7c7.zip
use time4_t(uint32_t) instead of time_t for x86-64 arch.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2426 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/xchatd.c')
-rw-r--r--util/xchatd.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/util/xchatd.c b/util/xchatd.c
index 22be9620..00c897e3 100644
--- a/util/xchatd.c
+++ b/util/xchatd.c
@@ -83,7 +83,7 @@ struct ChatUser
int uflag;
int clitype; /* Xshadow: client type. 1 for common client,
* 0 for bbs only client */
- time_t uptime; /* Thor: unused */
+ time4_t uptime; /* Thor: unused */
char userid[IDLEN + 1]; /* real userid */
char chatid[9]; /* chat id */
char lasthost[30]; /* host address */
@@ -223,12 +223,12 @@ logit(key, msg)
char *key;
char *msg;
{
- time_t now;
+ time4_t now;
struct tm *p;
char buf[512];
- time(&now);
- p = localtime(&now);
+ now = (time4_t)time(NULL);
+ p = localtime4(&now);
sprintf(buf, "%02d/%02d %02d:%02d:%02d %-13s%s\n",
p->tm_mon + 1, p->tm_mday,
p->tm_hour, p->tm_min, p->tm_sec, key, msg);
@@ -821,10 +821,9 @@ exit_room(user, mode, msg)
static char datemsg[32];
char *
-Ctime(clock)
- time_t *clock;
+Ctime(time4_t *clock)
{
- struct tm *t = localtime(clock);
+ struct tm *t = localtime4(clock);
static char week[] = "日一二三四五六";
sprintf(datemsg, "%d年%2d月%2d日%3d:%02d:%02d 星期%.2s",
@@ -891,9 +890,9 @@ chat_date(cu, msg)
ChatUser *cu;
char *msg;
{
- time_t thetime;
+ time4_t thetime;
- time(&thetime);
+ thetime = time(NULL);
sprintf(chatbuf, "◆ 標準時間: %s", Ctime(&thetime));
send_to_user(cu, chatbuf, 0, MSG_MESSAGE);
}
@@ -3288,7 +3287,7 @@ main()
register fd_set *rptr, *xptr;
fd_set rset, xset;
struct timeval tv;
- time_t uptime, tmaintain;
+ time4_t uptime, tmaintain;
msock = start_daemon();