浏览代码

Load timezone info before chroot

Fixes #13
tags/1.2
Timo Röhling 10 年前
父节点
当前提交
f430c83b82
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      postsrsd.c

+ 4
- 0
postsrsd.c 查看文件

@@ -234,6 +234,7 @@ int main (int argc, char **argv)
234 234
   struct passwd *pwd = NULL;
235 235
   char secretbuf[1024], *secret = NULL;
236 236
   char *tmp;
237
+  time_t now;
237 238
   srs_t *srs;
238 239
   struct pollfd fds[3];
239 240
   const char **excludes;
@@ -356,6 +357,9 @@ int main (int argc, char **argv)
356 357
 
357 358
   /* Open syslog now (NDELAY), because it may no longer reachable from chroot */
358 359
   openlog (self, LOG_PID | LOG_NDELAY, LOG_MAIL);
360
+  /* Force loading of timezone info (suggested by patrickdk77) */
361
+  now = time(NULL);
362
+  localtime (&now);
359 363
   /* We also have to lookup the uid of the unprivileged user for the same reason. */
360 364
   if (user) {
361 365
     errno = 0;

正在加载...
取消
保存