[BACK]Return to server.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/server.c between version 1.4 and 1.5

version 1.4, 2009/06/25 22:09:20 version 1.5, 2009/06/26 22:12:19
Line 25 
Line 25 
   
 #include <errno.h>  #include <errno.h>
 #include <fcntl.h>  #include <fcntl.h>
   #include <paths.h>
 #include <signal.h>  #include <signal.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 131 
Line 132 
 int  int
 server_start(char *path)  server_start(char *path)
 {  {
         int     pair[2], srv_fd;          int     pair[2], srv_fd, null_fd;
         char   *cause;          char   *cause;
         char    rpathbuf[MAXPATHLEN];          char    rpathbuf[MAXPATHLEN];
   
Line 175 
Line 176 
                 exit(1);                  exit(1);
         }          }
         logfile("server");          logfile("server");
   
           /*
            * Close stdin/stdout/stderr. Can't let daemon() do this as they are
            * needed until now to print configuration file errors.
            */
           if ((null_fd = open(_PATH_DEVNULL, O_RDWR)) != -1) {
                   dup2(null_fd, STDIN_FILENO);
                   dup2(null_fd, STDOUT_FILENO);
                   dup2(null_fd, STDERR_FILENO);
                   if (null_fd > 2)
                           close(null_fd);
           }
   
         log_debug("server started, pid %ld", (long) getpid());          log_debug("server started, pid %ld", (long) getpid());
         log_debug("socket path %s", socket_path);          log_debug("socket path %s", socket_path);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5