summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e90da75)
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.16
SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.21
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.16
-static char sccsid[] = "@(#)conf.c 8.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 8.16 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
pid_t
setsid __P ((void))
{
pid_t
setsid __P ((void))
{
+#ifdef TIOCNOTTY
+ int fd;
+
+ fd = open("/dev/tty", 2);
+ if (fd >= 0)
+ {
+ (void) ioctl(fd, (int) TIOCNOTTY, (char *) 0);
+ (void) close(fd);
+ }
+#endif /* TIOCNOTTY */
# ifdef SYSTEM5
return setpgrp();
# else
# ifdef SYSTEM5
return setpgrp();
# else
+ return setpgid(0, getpid());
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)conf.h 8.20 (Berkeley) %G%
+ * @(#)conf.h 8.21 (Berkeley) %G%
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define FORK fork /* no vfork primitive available */
# define HASSETREUID 1 /* has setreuid(2) call */
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define FORK fork /* no vfork primitive available */
-# define setpgrp BSDsetpgrp
+# define setpgid BSDsetpgrp
# define GIDSET_T gid_t
# endif
# define GIDSET_T gid_t
# endif
# define HASFLOCK 1 /* has flock(2) call */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define sleep sleepX
# define HASFLOCK 1 /* has flock(2) call */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define sleep sleepX
+# define setpgid setpgrp
# define LA_TYPE LA_ZERO
typedef int pid_t;
# ifndef _PATH_SENDMAILCF
# define LA_TYPE LA_ZERO
typedef int pid_t;
# ifndef _PATH_SENDMAILCF
# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define ARBPTR_T char *
# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define ARBPTR_T char *
+# define setpgid setpgrp
# ifndef LA_TYPE
# define LA_TYPE LA_FLOAT
# endif
# ifndef LA_TYPE
# define LA_TYPE LA_FLOAT
# endif
# define _PATH_UNIX "/unix"
#endif
# define _PATH_UNIX "/unix"
#endif
+/*
+** Linux 0.99pl10 and above...
+** From Karl London <karl@borg.demon.co.uk>.
+*/
+
+#ifdef linux
+# define BSD 1 /* pretend to be BSD based today */
+# undef NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
+# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+# ifndef LA_TYPE
+# define LA_TYPE LA_FLOAT
+# endif
+#endif
+
+
/**********************************************************************
** End of Per-Operating System defines
**********************************************************************/
/**********************************************************************
** End of Per-Operating System defines
**********************************************************************/
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 8.16 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
if (droplev > 1)
{
(void) setsid();
if (droplev > 1)
{
(void) setsid();
-#ifdef TIOCNOTTY
- fd = open("/dev/tty", 2);
- if (fd >= 0)
- {
- (void) ioctl(fd, (int) TIOCNOTTY, (char *) 0);
- (void) close(fd);
- }
- (void) setpgrp(0, 0);
-#endif /* TIOCNOTTY */