gettimeofday(&tv, NULL);
tm = localtime(&tv.tv_sec);
snprintf(buf, max, "%04d-%02d-%02d %02d:%02d:%02d.%03d",
- tm->tm_year, tm->tm_mon, tm->tm_mday,
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec,
(int)(tv.tv_usec / 1000));
}
};
static inline const struct passwd * getpwnam(const char *u) { return NULL; }
-/* fix localtime */
-static inline struct tm *w_localtime(const time_t *timep) {
- struct tm *res = localtime(timep);
- if (res) {
- res->tm_year += 1900;
- res->tm_mon += 1;
- }
- return res;
-}
-#define localtime(a) w_localtime(a)
-
/*
* fcntl
*/