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

Diff for /src/usr.bin/cvs/Attic/cvsd.c between version 1.9 and 1.10

version 1.9, 2004/09/27 12:39:29 version 1.10, 2004/09/27 13:42:39
Line 59 
Line 59 
   
   
   
 int foreground = 0;  int cvsd_fg = 0;
   
 volatile sig_atomic_t running = 1;  volatile sig_atomic_t cvsd_running = 1;
 volatile sig_atomic_t restart = 0;  volatile sig_atomic_t cvsd_restart = 0;
   
   
 uid_t  cvsd_uid = -1;  uid_t  cvsd_uid = -1;
Line 100 
Line 100 
 {  {
         switch (signo) {          switch (signo) {
         case SIGHUP:          case SIGHUP:
                 restart = 1;                  cvsd_restart = 1;
                 break;                  break;
         case SIGCHLD:          case SIGCHLD:
                 cvsd_sigchld = 1;                  cvsd_sigchld = 1;
Line 108 
Line 108 
         case SIGINT:          case SIGINT:
         case SIGTERM:          case SIGTERM:
         case SIGQUIT:          case SIGQUIT:
                 running = 0;                  cvsd_running = 0;
                 break;                  break;
         case SIGINFO:          case SIGINFO:
                 cvsd_siginfo = 1;                  cvsd_siginfo = 1;
Line 168 
Line 168 
                         cvs_log_filter(LP_FILTER_UNSET, LP_INFO);                          cvs_log_filter(LP_FILTER_UNSET, LP_INFO);
                         break;                          break;
                 case 'f':                  case 'f':
                         foreground = 1;                          cvsd_fg = 1;
                         break;                          break;
                 case 'g':                  case 'g':
                         cvsd_set(CVSD_SET_GROUP, optarg);                          cvsd_set(CVSD_SET_GROUP, optarg);
Line 230 
Line 230 
         signal(SIGTERM, cvsd_sighdlr);          signal(SIGTERM, cvsd_sighdlr);
         signal(SIGCHLD, cvsd_sighdlr);          signal(SIGCHLD, cvsd_sighdlr);
   
         if (!foreground && daemon(0, 0) == -1) {          if (!cvsd_fg && daemon(0, 0) == -1) {
                 cvs_log(LP_ERRNO, "failed to become a daemon");                  cvs_log(LP_ERRNO, "failed to become a daemon");
                 exit(EX_OSERR);                  exit(EX_OSERR);
         }          }
Line 604 
Line 604 
         pfd = NULL;          pfd = NULL;
   
         for (;;) {          for (;;) {
                 if (!running)                  if (!cvsd_running)
                         break;                          break;
   
                 if (restart) {                  if (cvsd_restart) {
                         /* restart server */                          /* restart server */
                 }                  }
   
Line 711 
Line 711 
         pfd[0].events = POLLIN;          pfd[0].events = POLLIN;
         timeout = INFTIM;          timeout = INFTIM;
   
         while (running) {          while (cvsd_running) {
                 ret = poll(pfd, 1, timeout);                  ret = poll(pfd, 1, timeout);
                 if (ret == -1) {                  if (ret == -1) {
                         if (errno == EINTR)                          if (errno == EINTR)
Line 739 
Line 739 
                 case CVSD_MSG_PASSFD:                  case CVSD_MSG_PASSFD:
                         break;                          break;
                 case CVSD_MSG_SHUTDOWN:                  case CVSD_MSG_SHUTDOWN:
                         running = 0;                          cvsd_running = 0;
                         break;                          break;
                 default:                  default:
                         cvs_log(LP_ERR,                          cvs_log(LP_ERR,

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10