summaryrefslogtreecommitdiff
path: root/net/rmsg/files/patch-ad
blob: 023cb649b00f1f7a3a2af4816502d846550fc920 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
*** 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)