1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-31 21:57:12 +00:00
freebsd-ports/net/rmsg/files/patch-ad
1999-09-20 02:22:39 +00:00

67 lines
1.7 KiB
Plaintext

*** server.c.orig Sat Jun 26 16:23:23 1993
--- server.c Sun Sep 19 16:48:42 1999
***************
*** 66,72 ****
#else
char *malloc();
#endif
! long time();
uid_t getuid();
char *progname;
int debug = 0;
--- 66,72 ----
#else
char *malloc();
#endif
! time_t time();
uid_t getuid();
char *progname;
int debug = 0;
***************
*** 99,118 ****
}
if (! strcmp (basename (progname), "rmsgd")) {
if (fork()) _exit(0); /* make myself a daemon */
! #ifdef BSD
fd = open("/dev/tty", O_RDWR); /* disconnect from control tty */
if (fd >= 0) {
(void) ioctl(fd, TIOCNOTTY, (char *)0);
(void) close(fd); /* close this, don't need any more*/
}
! #else
(void) setpgrp ();
#endif
}
else {
! (void) fprintf (stderr, "Starting from inetd not yet supported, rename me ase rmsgd and start\nfrom /etc/rc\n");
}
if (argc > 1)
--- 99,122 ----
}
if (! strcmp (basename (progname), "rmsgd")) {
+ #if (defined(BSD) && (BSD >= 199306))
+ (void)daemon(0,0);
+ #else
if (fork()) _exit(0); /* make myself a daemon */
! # ifdef BSD
fd = open("/dev/tty", O_RDWR); /* disconnect from control tty */
if (fd >= 0) {
(void) ioctl(fd, TIOCNOTTY, (char *)0);
(void) close(fd); /* close this, don't need any more*/
}
! # else
(void) setpgrp ();
+ # endif
#endif
}
else {
! (void) fprintf (stderr, "Starting from inetd not yet supported, rename me ase rmsgd and start\nfrom /etc/rc.local\n");
}
if (argc > 1)