ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/daemon.c
(Generate patch)

Comparing deliantra/server/server/daemon.c (file contents):
Revision 1.1.1.1 by root, Fri Feb 3 07:14:30 2006 UTC vs.
Revision 1.3 by elmex, Sun Aug 13 17:16:04 2006 UTC

1/* 1/*
2 * static char *rcsid_daemon_c = 2 * static char *rcsid_daemon_c =
3 * "$Id: daemon.c,v 1.1.1.1 2006/02/03 07:14:30 root Exp $"; 3 * "$Id: daemon.c,v 1.3 2006/08/13 17:16:04 elmex dead $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
105 */ 105 */
106 (void) open ("/", O_RDONLY); /* root inode already in core */ 106 (void) open ("/", O_RDONLY); /* root inode already in core */
107 (void) dup2 (0, 1); 107 (void) dup2 (0, 1);
108 (void) dup2 (0, 2); 108 (void) dup2 (0, 2);
109 109
110 if ((i = open ("/dev/tty", O_RDWR)) >= 0) { /* did open succeed? */
111#if (defined(SYSV) || defined(hpux)) && defined(TIOCTTY)
112 int zero = 0;
113 (void) ioctl (i, TIOCTTY, &zero);
114#else
115
116# ifdef HAVE_SYS_TERMIOS_H
117# include <sys/termios.h>
118# else
119# ifdef HAVE_SYS_TTYCOM_H
120# include <sys/ttycom.h>
121# endif
122# endif
123 (void) ioctl (i, TIOCNOTTY, (char *) 0); /* detach, BSD style */
124#endif
125 (void) close (i);
126 }
127
128
129#ifdef HAVE_SETSID
130 setsid(); 110 setsid();
131#else
132/* Are these really different? */
133# if defined(SYSV) || defined(SVR4)
134 setpgrp (0, 0);
135# else /* Non SYSV machines */
136 setpgrp (0, getpid());
137# endif
138#endif
139 return(logfile); 111 return(logfile);
140} 112}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines