Changeset 546


Ignore:
Timestamp:
02/12/10 12:32:55 (7 months ago)
Author:
eagle
Message:
  • fixed order of pid-process creation
  • AC_PROG_MKDIR_P was missing
  • child reaper was missing in case of pid-process getting killed
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r541 r546  
    113113LTLIBOBJS = @LTLIBOBJS@ 
    114114MAKEINFO = @MAKEINFO@ 
     115MKDIR_P = @MKDIR_P@ 
    115116OBJEXT = @OBJEXT@ 
    116117PACKAGE = @PACKAGE@ 
  • trunk/config.h.in

    r502 r546  
    8888#undef HAVE_SYS_TYPES_H 
    8989 
     90/* Define to 1 if you have the <sys/wait.h> header file. */ 
     91#undef HAVE_SYS_WAIT_H 
     92 
    9093/* enable RTT measurement */ 
    9194#undef MEASURE_RTT 
  • trunk/configure

    r545 r546  
    11#! /bin/sh 
    22# Guess values for system-dependent variables and create Makefiles. 
    3 # Generated by GNU Autoconf 2.62 for onioncat 0.2.2.r545. 
     3# Generated by GNU Autoconf 2.62 for onioncat 0.2.2.r546. 
    44# 
    55# Report bugs to <rahra@cypherpunk.at>. 
     
    597597PACKAGE_NAME='onioncat' 
    598598PACKAGE_TARNAME='onioncat' 
    599 PACKAGE_VERSION='0.2.2.r545' 
    600 PACKAGE_STRING='onioncat 0.2.2.r545' 
     599PACKAGE_VERSION='0.2.2.r546' 
     600PACKAGE_STRING='onioncat 0.2.2.r546' 
    601601PACKAGE_BUGREPORT='rahra@cypherpunk.at' 
    602602 
     
    676676am__fastdepCC_FALSE 
    677677LN_S 
     678MKDIR_P 
    678679build 
    679680build_cpu 
     
    12611262  # This message is too long to be a string in the A/UX 3.1 sh. 
    12621263  cat <<_ACEOF 
    1263 \`configure' configures onioncat 0.2.2.r545 to adapt to many kinds of systems. 
     1264\`configure' configures onioncat 0.2.2.r546 to adapt to many kinds of systems. 
    12641265 
    12651266Usage: $0 [OPTION]... [VAR=VALUE]... 
     
    13311332if test -n "$ac_init_help"; then 
    13321333  case $ac_init_help in 
    1333      short | recursive ) echo "Configuration of onioncat 0.2.2.r545:";; 
     1334     short | recursive ) echo "Configuration of onioncat 0.2.2.r546:";; 
    13341335   esac 
    13351336  cat <<\_ACEOF 
     
    14231424if $ac_init_version; then 
    14241425  cat <<\_ACEOF 
    1425 onioncat configure 0.2.2.r545 
     1426onioncat configure 0.2.2.r546 
    14261427generated by GNU Autoconf 2.62 
    14271428 
     
    14371438running configure, to aid debugging if configure makes a mistake. 
    14381439 
    1439 It was created by onioncat $as_me 0.2.2.r545, which was 
     1440It was created by onioncat $as_me 0.2.2.r546, which was 
    14401441generated by GNU Autoconf 2.62.  Invocation command line was 
    14411442 
     
    20862087# Define the identity of the package. 
    20872088 PACKAGE='onioncat' 
    2088  VERSION='0.2.2.r545' 
     2089 VERSION='0.2.2.r546' 
    20892090 
    20902091 
     
    22372238 
    22382239cat >>confdefs.h <<\_ACEOF 
    2239 #define SVN_REVISION "545" 
     2240#define SVN_REVISION "546" 
    22402241_ACEOF 
    22412242 
     
    34163417$as_echo "no, using $LN_S" >&6; } 
    34173418fi 
     3419 
     3420{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 
     3421$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } 
     3422if test -z "$MKDIR_P"; then 
     3423  if test "${ac_cv_path_mkdir+set}" = set; then 
     3424  $as_echo_n "(cached) " >&6 
     3425else 
     3426  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
     3427for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin 
     3428do 
     3429  IFS=$as_save_IFS 
     3430  test -z "$as_dir" && as_dir=. 
     3431  for ac_prog in mkdir gmkdir; do 
     3432         for ac_exec_ext in '' $ac_executable_extensions; do 
     3433           { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue 
     3434           case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 
     3435             'mkdir (GNU coreutils) '* | \ 
     3436             'mkdir (coreutils) '* | \ 
     3437             'mkdir (fileutils) '4.1*) 
     3438               ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext 
     3439               break 3;; 
     3440           esac 
     3441         done 
     3442       done 
     3443done 
     3444IFS=$as_save_IFS 
     3445 
     3446fi 
     3447 
     3448  if test "${ac_cv_path_mkdir+set}" = set; then 
     3449    MKDIR_P="$ac_cv_path_mkdir -p" 
     3450  else 
     3451    # As a last resort, use the slow shell script.  Don't cache a 
     3452    # value for MKDIR_P within a source directory, because that will 
     3453    # break other packages using the cache if that directory is 
     3454    # removed, or if the value is a relative name. 
     3455    test -d ./--version && rmdir ./--version 
     3456    MKDIR_P="$ac_install_sh -d" 
     3457  fi 
     3458fi 
     3459{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 
     3460$as_echo "$MKDIR_P" >&6; } 
    34183461 
    34193462 
     
    40764119 
    40774120 
    4078 for ac_header in sys/types.h sys/socket.h netinet/in.h netinet/in_systm.h netinet/ip.h netinet/ip6.h netinet/in6.h net/if.h net/if_tun.h linux/if_tun.h linux/sockios.h endian.h sys/endian.h netinet/icmp6.h net/ethernet.h netinet/if_ether.h netinet/ether.h 
     4121 
     4122for ac_header in sys/types.h sys/wait.h sys/socket.h netinet/in.h netinet/in_systm.h netinet/ip.h netinet/ip6.h netinet/in6.h net/if.h net/if_tun.h linux/if_tun.h linux/sockios.h endian.h sys/endian.h netinet/icmp6.h net/ethernet.h netinet/if_ether.h netinet/ether.h 
    40794123do 
    40804124as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     
    53265370# values after options handling. 
    53275371ac_log=" 
    5328 This file was extended by onioncat $as_me 0.2.2.r545, which was 
     5372This file was extended by onioncat $as_me 0.2.2.r546, which was 
    53295373generated by GNU Autoconf 2.62.  Invocation command line was 
    53305374 
     
    53795423cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 
    53805424ac_cs_version="\\ 
    5381 onioncat config.status 0.2.2.r545 
     5425onioncat config.status 0.2.2.r546 
    53825426configured by $0, generated by GNU Autoconf 2.62, 
    53835427  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" 
     
    53905434srcdir='$srcdir' 
    53915435INSTALL='$INSTALL' 
     5436MKDIR_P='$MKDIR_P' 
    53925437AWK='$AWK' 
    53935438test -n "\$AWK" || AWK=awk 
     
    60066051  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; 
    60076052  esac 
     6053  ac_MKDIR_P=$MKDIR_P 
     6054  case $MKDIR_P in 
     6055  [\\/$]* | ?:[\\/]* ) ;; 
     6056  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; 
     6057  esac 
    60086058_ACEOF 
    60096059 
     
    60626112s&@abs_top_builddir@&$ac_abs_top_builddir&;t t 
    60636113s&@INSTALL@&$ac_INSTALL&;t t 
     6114s&@MKDIR_P@&$ac_MKDIR_P&;t t 
    60646115$ac_datarootdir_hack 
    60656116" 
  • trunk/configure.ac

    r541 r546  
    2121#AC_PROG_INSTALL 
    2222AC_PROG_LN_S 
     23AC_PROG_MKDIR_P 
    2324 
    2425m4_include([ax_pthread.m4]) 
     
    3637# Checks for header files. 
    3738#AC_HEADER_STDC 
    38 AC_CHECK_HEADERS([sys/types.h sys/socket.h netinet/in.h netinet/in_systm.h netinet/ip.h netinet/ip6.h netinet/in6.h net/if.h net/if_tun.h linux/if_tun.h linux/sockios.h endian.h sys/endian.h netinet/icmp6.h net/ethernet.h netinet/if_ether.h netinet/ether.h], [], [], 
     39AC_CHECK_HEADERS([sys/types.h sys/wait.h sys/socket.h netinet/in.h netinet/in_systm.h netinet/ip.h netinet/ip6.h netinet/in6.h net/if.h net/if_tun.h linux/if_tun.h linux/sockios.h endian.h sys/endian.h netinet/icmp6.h net/ethernet.h netinet/if_ether.h netinet/ether.h], [], [], 
    3940[[ 
    4041#ifdef HAVE_SYS_TYPES_H 
  • trunk/debian/Makefile.in

    r540 r546  
    7878LTLIBOBJS = @LTLIBOBJS@ 
    7979MAKEINFO = @MAKEINFO@ 
     80MKDIR_P = @MKDIR_P@ 
    8081OBJEXT = @OBJEXT@ 
    8182PACKAGE = @PACKAGE@ 
  • trunk/freebsd/Makefile.in

    r540 r546  
    7878LTLIBOBJS = @LTLIBOBJS@ 
    7979MAKEINFO = @MAKEINFO@ 
     80MKDIR_P = @MKDIR_P@ 
    8081OBJEXT = @OBJEXT@ 
    8182PACKAGE = @PACKAGE@ 
  • trunk/i2p/Makefile.in

    r541 r546  
    8989LTLIBOBJS = @LTLIBOBJS@ 
    9090MAKEINFO = @MAKEINFO@ 
     91MKDIR_P = @MKDIR_P@ 
    9192OBJEXT = @OBJEXT@ 
    9293PACKAGE = @PACKAGE@ 
  • trunk/man/Makefile.in

    r540 r546  
    8282LTLIBOBJS = @LTLIBOBJS@ 
    8383MAKEINFO = @MAKEINFO@ 
     84MKDIR_P = @MKDIR_P@ 
    8485OBJEXT = @OBJEXT@ 
    8586PACKAGE = @PACKAGE@ 
  • trunk/src/Makefile.in

    r544 r546  
    104104LTLIBOBJS = @LTLIBOBJS@ 
    105105MAKEINFO = @MAKEINFO@ 
     106MKDIR_P = @MKDIR_P@ 
    106107OBJEXT = @OBJEXT@ 
    107108PACKAGE = @PACKAGE@ 
  • trunk/src/cygwin/Makefile.in

    r544 r546  
    8383LTLIBOBJS = @LTLIBOBJS@ 
    8484MAKEINFO = @MAKEINFO@ 
     85MKDIR_P = @MKDIR_P@ 
    8586OBJEXT = @OBJEXT@ 
    8687PACKAGE = @PACKAGE@ 
  • trunk/src/ocat.c

    r545 r546  
    9191 
    9292 
    93 int mk_pid_file(uid_t uid) 
     93int mk_pid_file(void) 
    9494{ 
    9595   FILE *f; 
     
    122122      case 0: 
    123123         oe_close(CNF(pid_fd[1])); 
     124 
     125         // close tunnel device 
     126         oe_close(CNF(tunfd[0])); 
     127         if (CNF(tunfd[0]) != CNF(tunfd[1])) 
     128            oe_close(CNF(tunfd[1])); 
     129 
     130         // wait for something happening on pipe 
    124131         if (read(CNF(pid_fd[0]), &c, 1) == -1) 
    125132            log_msg(LOG_ERR, "error reading from pid_fd %d: \"%s\"", 
     
    129136            log_msg(LOG_WARNING, "error deleting pid ]ile \"%s\": \"%s\"", 
    130137                  CNF(pid_file), strerror(errno)), exit(1); 
     138         log_msg(LOG_INFO, "pid file deleted, exiting."); 
    131139         exit(0); 
    132140 
     
    183191void sig_handler(int sig) 
    184192{ 
     193   int status; 
     194 
    185195   switch (sig) 
    186196   { 
     197      case SIGCHLD: 
     198         // FIXME: there should be some error handling 
     199         (void) waitpid(-1, &status, WNOHANG); 
     200 
    187201      case SIGTERM: 
    188202      case SIGINT: 
     
    216230   if (sigaction(SIGUSR1, &sa, NULL) == -1) 
    217231      log_msg(LOG_ERR, "could not install SIGUSR1 handler: \"%s\"", strerror(errno)), exit(1); 
     232   if (sigaction(SIGCHLD, &sa, NULL) == -1) 
     233      log_msg(LOG_ERR, "could not install SIGCHLD handler: \"%s\"", strerror(errno)), exit(1); 
     234 
    218235} 
    219236 
     
    551568   if (CNF(daemon)) 
    552569      background(); 
     570 
     571   // create pid_file 
     572   if (CNF(create_pid_file)) 
     573      mk_pid_file(); 
    553574 
    554575   if (!CNF(oc_listen)) 
     
    580601   } 
    581602 
    582    // create pid_file 
    583    if (CNF(create_pid_file)) 
    584       mk_pid_file(pwd->pw_uid); 
    585  
    586603   if (!CNF(runasroot) && !getuid()) 
    587604   { 
  • trunk/src/ocat.h

    r539 r546  
    5252#ifdef HAVE_SYS_TYPES_H 
    5353#include <sys/types.h> 
     54#endif 
     55#ifdef HAVE_SYS_WAIT_H 
     56#include <sys/wait.h> 
    5457#endif 
    5558#ifdef HAVE_NETINET_IN_H 
  • trunk/src/ocatctrl.c

    r538 r546  
    5656      { 
    5757         log_msg(LOG_ERR, "could not open %d for writing: %s", fd, strerror(errno)); 
     58         oe_close(pfd[0]); 
     59         oe_close(pfd[1]); 
    5860         return NULL; 
    5961      } 
     
    6971         log_msg(LOG_ERR, "could not open %d for reading: %s", fd, strerror(errno)); 
    7072         CNF(config_read) = 1; 
     73         oe_close(pfd[0]); 
     74         oe_close(pfd[1]); 
    7175         return NULL; 
    7276      } 
Note: See TracChangeset for help on using the changeset viewer.