[lug] help with signals

Ken Weinert kenw at ihs.com
Wed Jun 28 15:38:39 MDT 2000


Hi all:
	I've got some old code that uses sigmask, etc. Can anyone help
me in getting it converted to using the newer sigaction stuff? Signals
remain one of those things that I've use *very* infrequently and I still
don't have it sorted in my head yet.

	Here's the relevant code:

  *fd = socket (AF_INET, SOCK_STREAM, 0);
  for (i = 0; i < MAX_RETRYS; i++)
   { int mask = sigmask(SIGALRM);

     mask = sigblock(mask);
     rc = connect(*fd, &name, sizeof (name));
     sigsetmask(mask);

    if (rc == 0)
      return(true);
    else if (errno == EINTR)
      sleep(1);
    else break;
  }

	Any assistance will be greatly appreciated. Thanks.

-- 
Ken Weinert   kenw at ihs.com 303-858-6956 (V) 978-336-5652 (F)
PGP: DF 2B 6C 72 33 BE 06 D1  9D C4 ED 32 36 97 C0 6E
If things get any worse, I'll have to ask you to stop helping me.





More information about the LUG mailing list