~ubuntu-branches/ubuntu/saucy/xinetd/saucy

« back to all changes in this revision

Viewing changes to xinetd/signals.c

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2013-08-14 19:26:27 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20130814192627-4guvw89l76qp20uh
Tags: 1:2.3.15-1ubuntu1
* Merge from Debian unstable. Remaining changes:
  - Add xinetd upstart job.

Show diffs side-by-side

added added

removed removed

Lines of Context:
402
402
 */
403
403
static void my_handler( int sig )
404
404
{
405
 
   int ret_val;
 
405
   ssize_t ret_val;
406
406
   int saved_errno = errno;
407
407
#if NSIG < 256
408
408
   unsigned char sig_byte;
412
412
   do
413
413
   {
414
414
      ret_val = write(signals_pending[1], &sig_byte, 1);
415
 
   } while (ret_val == -1 && errno == EINTR);
 
415
   } while (ret_val == (ssize_t)-1 && errno == EINTR);
416
416
#else
417
417
   if (signals_pending[1] < 0) return;
418
418
   do
419
419
   {
420
420
      ret_val = write(signals_pending[1], &sig, sizeof(int));
421
 
   } while (ret_val == -1 && errno == EINTR);
 
421
   } while (ret_val == (ssize_t)-1 && errno == EINTR);
422
422
#endif
423
423
   errno = saved_errno;
424
424
}
470
470
#endif
471
471
 
472
472
   while( --i >= 0 ) {
473
 
      int ret_val;
 
473
      ssize_t ret_val;
474
474
      do
475
475
      {
476
476
         ret_val = read(signals_pending[0], &sig, sizeof(sig));
477
 
      } while (ret_val == -1 && errno == EINTR);
478
 
      if (ret_val != sizeof(sig) ) {
 
477
      } while (ret_val == (ssize_t)-1 && errno == EINTR);
 
478
      if (ret_val != (ssize_t)sizeof(sig) ) {
479
479
         msg(LOG_ERR, func, "Error retrieving pending signal: %m");
480
480
         return;
481
481
      }