[10596] in Athena Bugs

home help back first fref pref prev next nref lref last post

athena/ucb/lpr/lpd.c

daemon@ATHENA.MIT.EDU (brlewis@Athena.MIT.EDU)
Fri Jun 25 13:01:08 1993

From: brlewis@Athena.MIT.EDU
Date: Fri, 25 Jun 93 13:01:01 -0400
To: rel-eng@Athena.MIT.EDU, bugs@Athena.MIT.EDU

In POSIX, setsid() is really the right thing to call in a server program
when it wants to dissociate itself from the controlling terminal.
However, I wasn't planning on testing this on other platforms, so I did
ifdef hpux instead of ifdef POSIX.

*** /tmp/,RCSt1a18638	Fri Jun 25 12:58:07 1993
--- athena/ucb/lpr/lpd.c	Mon Jun 14 11:44:50 1993
***************
*** 139,145 ****
--- 139,149 ----
  	(void) dup(1);
  	f = open("/dev/tty", O_RDWR);
  	if (f > 0) {
+ #ifdef hpux
+ 		setsid();
+ #else
  		ioctl(f, TIOCNOTTY, 0);
+ #endif
  		(void) close(f);
  	}
  #endif
***************
*** 685,691 ****
  	putchar('\n');
  }
  
! #if defined(_AUX_SOURCE)
  _validuser(hostf, rhost, luser, ruser, baselen)
  char *rhost, *luser, *ruser;
  FILE *hostf;
--- 689,695 ----
  	putchar('\n');
  }
  
! #if defined(_AUX_SOURCE) || defined(hpux)
  _validuser(hostf, rhost, luser, ruser, baselen)
  char *rhost, *luser, *ruser;
  FILE *hostf;

home help back first fref pref prev next nref lref last post