Ignore:
Timestamp:
Apr 30, 2008, 11:56:45 PM (16 years ago)
Author:
katerina
Message:

Plenty of compiler warnings fixed, SQL query length fixed, doc update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_processcheck.c

    r169 r170  
    394394}
    395395
     396/* These variables are not used anywhere. They only exist
     397 * to assign &userold, &user to them, which keeps gcc from
     398 * putting them into a register, and avoids the 'clobbered
     399 * by longjmp' warning. And no, 'volatile' proved insufficient.
     400 */
     401static void * sh_dummy_watchlist = NULL;
     402
    396403static void check_watchlist (short * res)
    397404{
     
    399406  char * tmp;
    400407  size_t indx;
     408
     409  /* Take the address to keep gcc from putting them into registers.
     410   * Avoids the 'clobbered by longjmp' warning.
     411   */
     412  sh_dummy_watchlist = (void*) &list;
    401413
    402414  while (list)
     
    409421            {
    410422              SH_MUTEX_LOCK(mutex_thread_nolog);
     423              tmp = sh_util_safe_name (list->str);
    411424              sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0,
    412425                              MSG_PCK_MISS,
    413                               list->str);
     426                              tmp);
    414427              SH_MUTEX_UNLOCK(mutex_thread_nolog);
    415428            }
     
    428441              if (S_FALSE == is_in_list(&list_missing, list->str, 0))
    429442                {
     443                  SH_MUTEX_LOCK(mutex_thread_nolog);
    430444                  tmp = sh_util_safe_name (list->str);
    431                   SH_MUTEX_LOCK(mutex_thread_nolog);
    432445                  sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0,
    433446                                  MSG_PCK_MISS,
     
    594607    }
    595608
    596   val = (val <= 0 ? 60 : val);
    597 
    598609  sh_prochk_interval = (time_t) val;
    599610  SL_RETURN(0, _("sh_prochk_set_interval"));
     
    625636static int proc_max_pid (size_t * procpid)
    626637{
     638  char * ret;
    627639  unsigned long  pid;
    628640  FILE * fd;
     
    640652        {
    641653          str[0] = '\0';
    642           fgets(str, 128, fd);
    643           if (*str != '\0')
     654          ret = fgets(str, 128, fd);
     655          if (ret && *str != '\0')
    644656            {
    645657              pid = strtoul(str, &ptr, 0);
     
    10551067static int sh_process_check_int (short * res)
    10561068{
    1057   size_t i, j;
     1069  volatile size_t i;
     1070  size_t j;
    10581071  char  tests[512];
    1059   int   retval;
     1072  volatile int   retval;
    10601073
    10611074  pid_t this_pid;
     
    12071220/* Initialise.
    12081221 */
    1209 static int sh_prochk_init_internal()
     1222static int sh_prochk_init_internal(void)
    12101223{
    12111224  SL_ENTER(_("sh_prochk_init"));
     
    12671280int sh_prochk_check(void)
    12681281{
    1269   int status = 0;
     1282  int status;
    12701283
    12711284  SL_ENTER(_("sh_prochk_check"));
    12721285
    12731286  SH_MUTEX_LOCK(mutex_proc_check);
     1287
     1288  status = 0;
     1289
    12741290  if( ShProchkActive != S_FALSE )
    12751291    {
Note: See TracChangeset for help on using the changeset viewer.