Masanobu Yasui authored on 2009/07/11 03:40:59
Showing 5 changed files
... ...
@@ -68,8 +68,8 @@
68 68
 /* Define to 1 if you have the `crypto' library (-lcrypto). */
69 69
 #undef HAVE_LIBCRYPTO
70 70
 
71
-/* Define to 1 if you have the `nls' library (-lnls). */
72
-#undef HAVE_LIBNLS
71
+/* Define to 1 if you have the `nsl' library (-lnsl). */
72
+#undef HAVE_LIBNSL
73 73
 
74 74
 /* Define to 1 if you have the `socket' library (-lsocket). */
75 75
 #undef HAVE_LIBSOCKET
... ...
@@ -3540,13 +3540,13 @@ _ACEOF
3540 3540
 fi
3541 3541
 
3542 3542
 
3543
-{ echo "$as_me:$LINENO: checking for inet_addr in -lnls" >&5
3544
-echo $ECHO_N "checking for inet_addr in -lnls... $ECHO_C" >&6; }
3545
-if test "${ac_cv_lib_nls_inet_addr+set}" = set; then
3543
+{ echo "$as_me:$LINENO: checking for inet_addr in -lnsl" >&5
3544
+echo $ECHO_N "checking for inet_addr in -lnsl... $ECHO_C" >&6; }
3545
+if test "${ac_cv_lib_nsl_inet_addr+set}" = set; then
3546 3546
   echo $ECHO_N "(cached) $ECHO_C" >&6
3547 3547
 else
3548 3548
   ac_check_lib_save_LIBS=$LIBS
3549
-LIBS="-lnls  $LIBS"
3549
+LIBS="-lnsl  $LIBS"
3550 3550
 cat >conftest.$ac_ext <<_ACEOF
3551 3551
 /* confdefs.h.  */
3552 3552
 _ACEOF
... ...
@@ -3587,26 +3587,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3587 3587
 	 test ! -s conftest.err
3588 3588
        } && test -s conftest$ac_exeext &&
3589 3589
        $as_test_x conftest$ac_exeext; then
3590
-  ac_cv_lib_nls_inet_addr=yes
3590
+  ac_cv_lib_nsl_inet_addr=yes
3591 3591
 else
3592 3592
   echo "$as_me: failed program was:" >&5
3593 3593
 sed 's/^/| /' conftest.$ac_ext >&5
3594 3594
 
3595
-	ac_cv_lib_nls_inet_addr=no
3595
+	ac_cv_lib_nsl_inet_addr=no
3596 3596
 fi
3597 3597
 
3598 3598
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
3599 3599
       conftest$ac_exeext conftest.$ac_ext
3600 3600
 LIBS=$ac_check_lib_save_LIBS
3601 3601
 fi
3602
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nls_inet_addr" >&5
3603
-echo "${ECHO_T}$ac_cv_lib_nls_inet_addr" >&6; }
3604
-if test $ac_cv_lib_nls_inet_addr = yes; then
3602
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_addr" >&5
3603
+echo "${ECHO_T}$ac_cv_lib_nsl_inet_addr" >&6; }
3604
+if test $ac_cv_lib_nsl_inet_addr = yes; then
3605 3605
   cat >>confdefs.h <<_ACEOF
3606
-#define HAVE_LIBNLS 1
3606
+#define HAVE_LIBNSL 1
3607 3607
 _ACEOF
3608 3608
 
3609
-  LIBS="-lnls $LIBS"
3609
+  LIBS="-lnsl $LIBS"
3610 3610
 
3611 3611
 fi
3612 3612
 
... ...
@@ -19,7 +19,7 @@ AC_PROG_INSTALL
19 19
 # Checks for libraries.
20 20
 AC_CHECK_LIB(crypto, MD5_Init)
21 21
 AC_CHECK_LIB(socket, socket)
22
-AC_CHECK_LIB(nls, inet_addr)
22
+AC_CHECK_LIB(nsl, inet_addr)
23 23
 
24 24
 # Checks for header files.
25 25
 AC_HEADER_DIRENT
... ...
@@ -385,7 +385,7 @@ int mexec_send(mcomm *c, int n, int sync)
385 385
   optind   = 1;
386 386
   optreset = 1;
387 387
 #else
388
-  optind = 0;
388
+  optind   = 1;
389 389
 #endif
390 390
   while((i=getopt(c->argc[n], argv, "g:t:nr")) != -1){
391 391
     switch(i){
... ...
@@ -508,15 +508,12 @@ static void minit_chdir()
508 508
 
509 509
 static void minit_chroot()
510 510
 {
511
-  time_t ttime;
512
-  struct tm *t;
513 511
   char tz[256];
514 512
   if(moption.chroot){
515
-    time(&ttime);
516 513
     tzset();
517
-    t = localtime(&ttime);
518
-    sprintf(tz, "%s%+ld",   t->tm_zone, -(t->tm_gmtoff/3600));
514
+    sprintf(tz, "%s%+ld", tzname[0], timezone/3600);
519 515
     setenv("TZ", tz, 0);
516
+    tzset();
520 517
     if(chroot(moption.base_dir) == -1){
521 518
       fprintf(stderr, "%s: can't chroot %s\n", __func__, moption.base_dir);
522 519
       exit(1);