Changeset 200 for trunk/src/sh_socket.c


Ignore:
Timestamp:
Nov 27, 2008, 10:26:50 PM (16 years ago)
Author:
katerina
Message:

Implement server->client SCAN command to run file check on demand.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_socket.c

    r177 r200  
    5353      SL_RET0(_("sh_socket_server_cmd"));
    5454    }
    55   if ((srvcmd[0] == 'S') || (srvcmd[1] == 'T') ||
    56       (srvcmd[2] == 'O') || (srvcmd[3] == 'P'))
     55  if ((srvcmd[0] == 'S') && (srvcmd[1] == 'T') &&
     56      (srvcmd[2] == 'O') && (srvcmd[3] == 'P'))
    5757    {
    5858      TPT((0, FIL__, __LINE__, _("msg=<stop command from server>\n")));
     
    6060      raise(SIGQUIT);
    6161#else
    62       TPT((0, FIL__, __LINE__, _("msg=<sigquit not defined>\n")));
     62      sig_terminate       = 1;
     63      ++sig_raised;
    6364#endif
    6465    }
    65   else if ((srvcmd[0] == 'R') || (srvcmd[1] == 'E') ||
    66            (srvcmd[2] == 'L') || (srvcmd[3] == 'O') ||
    67            (srvcmd[4] == 'A') || (srvcmd[5] == 'D'))
     66  else if ((srvcmd[0] == 'R') && (srvcmd[1] == 'E') &&
     67           (srvcmd[2] == 'L') && (srvcmd[3] == 'O') &&
     68           (srvcmd[4] == 'A') && (srvcmd[5] == 'D'))
    6869    {
    6970      TPT((0, FIL__, __LINE__, _("msg=<reload command from server>\n")));
     
    7172      raise(SIGHUP);
    7273#else
    73       TPT((0, FIL__, __LINE__, _("msg=<sighup not defined>\n")));
    74 #endif
     74      sig_config_read_again = 1;
     75      ++sig_raised;
     76#endif
     77    }
     78  else if ((srvcmd[0] == 'S') && (srvcmd[1] == 'C') &&
     79           (srvcmd[2] == 'A') && (srvcmd[3] == 'N'))
     80    {
     81      TPT((0, FIL__, __LINE__, _("msg=<scan command from server>\n")));
     82      if (sh.flag.isdaemon == ON)
     83        {
     84#ifdef SIGTTOU
     85          raise(SIGTTOU);
     86#else
     87          sig_force_check = 1;
     88          ++sig_raised;
     89#endif
     90        }
     91      else
     92        {
     93          sig_force_check = 1;
     94          ++sig_raised;
     95        }
    7596    }
    7697  else
Note: See TracChangeset for help on using the changeset viewer.