kannan@OAR.NET ("Kannan Varadhan") (01/17/91)
A few people have sent me mail saying that they were getting the setsid() stuff, and that their code does have perror() etc. and that they are seeing the same problems. Well, it turns out that Karl Fox just put in a new version of ppp on tut the other day. Please pick that up and try it out. The stuff on tut.cis.ohio-state.edu [128.146.8.60 if you don't know about things like DNS..and fie on you, you ^%!@$#&^#@ for not using the DNS :-)] is.... pub/ppp-sparc4.1.tar.Z [The whole patched shebang pub/ppp-sparc4.1.shar.Z [Just the patches, and K. Fox's kit. The code fragments should look as follows.... valhalla ppp. rcsdiff -r1.1 -c ppp.c =================================================================== RCS file: RCS/ppp.c,v retrieving revision 1.1 diff -c -r1.1 ppp.c *** /tmp/,RCSt1a03335 Wed Jan 16 15:22:18 1991 - --- ppp.c Mon Dec 31 12:05:48 1990 *************** *** 105,110 **** - --- 112,120 ---- #endif int initfdflags; /* Initial file descriptor flags */ int pid; /* Our pid */ + #ifdef sun + int pgrpid; /* Process Group ID */ + #endif char user[80]; /* User name */ *************** *** 371,386 **** pid = getpid(); if (debug) printf("Pid %d.\n", pid); ! /* if (ioctl(fd, TIOCSPGRP, &pid) < 0) { ! perror("ppp: ioctl(TIOCSPGRP)"); ! exit(1); ! }*/ ! { int a; ! if ((a=tcsetpgrp(fd, pid)) < 0) { ! printf("ppp: errno=%d\n", errno); perror("ppp: tcsetpgrp()"); exit(1); ! }} /* * Compute mask of all interesting signals and install signal handlers - --- 381,401 ---- pid = getpid(); if (debug) printf("Pid %d.\n", pid); ! ! # if defined(sun) && defined(SunOS) && SunOS >= 41 ! if ((pgrpid = setsid()) < 0) { ! pgrpid = getpgrp (0); ! } ! if (tcsetpgrp(fd, pgrpid) < 0) { perror("ppp: tcsetpgrp()"); exit(1); ! } ! # else ! if (ioctl(fd, TIOCSPGRP, &pid) < 0) { ! perror("ppp: ioctl(TIOCSPGRP)"); ! exit(1); ! } ! # endif /* * Compute mask of all interesting signals and install signal handlers valhalla ppp. FYI, Kannan -=- Kannan Varadhan, Internet Engineer (OARNet), +1 614 292 4137 Ohio Supercomputer Center, 1224, Kinnear Rd., Columbus, OH 43212