main.c (159609) | main.c (161389) |
---|---|
1/* 2 * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set --- 11 unchanged lines hidden (view full) --- 20SM_UNUSED(static char copyright[]) = 21"@(#) Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.\n\ 22 All rights reserved.\n\ 23 Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.\n\ 24 Copyright (c) 1988, 1993\n\ 25 The Regents of the University of California. All rights reserved.\n"; 26#endif /* ! lint */ 27 | 1/* 2 * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set --- 11 unchanged lines hidden (view full) --- 20SM_UNUSED(static char copyright[]) = 21"@(#) Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.\n\ 22 All rights reserved.\n\ 23 Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.\n\ 24 Copyright (c) 1988, 1993\n\ 25 The Regents of the University of California. All rights reserved.\n"; 26#endif /* ! lint */ 27 |
28SM_RCSID("@(#)$Id: main.c,v 8.944 2006/04/21 23:56:42 ca Exp $") | 28SM_RCSID("@(#)$Id: main.c,v 8.944.2.2 2006/08/03 22:05:03 ca Exp $") |
29 30 31#if NETINET || NETINET6 32# include <arpa/inet.h> 33#endif /* NETINET || NETINET6 */ 34 35/* for getcfname() */ 36#include <sendmail/pathnames.h> --- 2247 unchanged lines hidden (view full) --- 2284 ** We check for any errors that might have happened 2285 ** during startup. 2286 */ 2287 2288 if (OpMode == MD_DAEMON || QueueIntvl > 0) 2289 { 2290 char dtype[200]; 2291 | 29 30 31#if NETINET || NETINET6 32# include <arpa/inet.h> 33#endif /* NETINET || NETINET6 */ 34 35/* for getcfname() */ 36#include <sendmail/pathnames.h> --- 2247 unchanged lines hidden (view full) --- 2284 ** We check for any errors that might have happened 2285 ** during startup. 2286 */ 2287 2288 if (OpMode == MD_DAEMON || QueueIntvl > 0) 2289 { 2290 char dtype[200]; 2291 |
2292 /* avoid cleanup in finis(), DaemonPid will be set below */ 2293 DaemonPid = 0; |
|
2292 if (!run_in_foreground && !tTd(99, 100)) 2293 { 2294 /* put us in background */ 2295 i = fork(); 2296 if (i < 0) 2297 syserr("daemon: cannot fork"); 2298 if (i != 0) 2299 { --- 16 unchanged lines hidden (view full) --- 2316 sm_exc_newthread(fatal_error); 2317 2318 /* disconnect from our controlling tty */ 2319 disconnect(2, &MainEnvelope); 2320 } 2321 2322 dtype[0] = '\0'; 2323 if (OpMode == MD_DAEMON) | 2294 if (!run_in_foreground && !tTd(99, 100)) 2295 { 2296 /* put us in background */ 2297 i = fork(); 2298 if (i < 0) 2299 syserr("daemon: cannot fork"); 2300 if (i != 0) 2301 { --- 16 unchanged lines hidden (view full) --- 2318 sm_exc_newthread(fatal_error); 2319 2320 /* disconnect from our controlling tty */ 2321 disconnect(2, &MainEnvelope); 2322 } 2323 2324 dtype[0] = '\0'; 2325 if (OpMode == MD_DAEMON) |
2326 { |
|
2324 (void) sm_strlcat(dtype, "+SMTP", sizeof dtype); | 2327 (void) sm_strlcat(dtype, "+SMTP", sizeof dtype); |
2328 DaemonPid = CurrentPid; 2329 } |
|
2325 if (QueueIntvl > 0) 2326 { 2327 (void) sm_strlcat2(dtype, 2328 queuepersistent 2329 ? "+persistent-queueing@" 2330 : "+queueing@", 2331 pintvl(QueueIntvl, true), 2332 sizeof dtype); --- 565 unchanged lines hidden (view full) --- 2898 CurEnv->e_to = NULL; 2899 if (drop) 2900 { 2901 if (CurEnv->e_id != NULL) 2902 { 2903 dropenvelope(CurEnv, true, false); 2904 sm_rpool_free(CurEnv->e_rpool); 2905 CurEnv->e_rpool = NULL; | 2330 if (QueueIntvl > 0) 2331 { 2332 (void) sm_strlcat2(dtype, 2333 queuepersistent 2334 ? "+persistent-queueing@" 2335 : "+queueing@", 2336 pintvl(QueueIntvl, true), 2337 sizeof dtype); --- 565 unchanged lines hidden (view full) --- 2903 CurEnv->e_to = NULL; 2904 if (drop) 2905 { 2906 if (CurEnv->e_id != NULL) 2907 { 2908 dropenvelope(CurEnv, true, false); 2909 sm_rpool_free(CurEnv->e_rpool); 2910 CurEnv->e_rpool = NULL; |
2911 2912 /* this may have pointed to the rpool */ 2913 CurEnv->e_to = NULL; |
|
2906 } 2907 else 2908 poststats(StatFile); 2909 } 2910 2911 /* flush any cached connections */ 2912 mci_flush(true, NULL); 2913 --- 1497 unchanged lines hidden --- | 2914 } 2915 else 2916 poststats(StatFile); 2917 } 2918 2919 /* flush any cached connections */ 2920 mci_flush(true, NULL); 2921 --- 1497 unchanged lines hidden --- |