summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-11 22:56:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-11 22:56:53 +0000
commitdb0c7fae77b60857adf9dd083a1b6ce524a6808f (patch)
tree8391b916047ce3581a39658232423cd446056bff /src
parenta25765a1cfff9bde6300f15ee7515c4675f33221 (diff)
Fix double printing of 'setting log file' and 'setting config file' paths.
Add comment about not using direct pointer from GetCommandLine() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7278 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 3fe830b13..7d2fd2ad4 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -78,7 +78,12 @@ DWORD WindowsForkStart(InspIRCd * Instance)
// Launch our "forked" process.
BOOL bSuccess = CreateProcess ( module, // Module (exe) filename
- strdup(GetCommandLine()), // Command line (exe plus parameters from the OS)
+ strdup(GetCommandLine()), // Command line (exe plus parameters from the OS)
+ // NOTE: We cannot return the direct value of the
+ // GetCommandLine function here, as the pointer is
+ // passed straight to the child process, and will be
+ // invalid once we exit as it goes out of context.
+ // strdup() seems ok, though.
0, // PROCESS_SECURITY_ATTRIBUTES
0, // THREAD_SECURITY_ATTRIBUTES
TRUE, // We went to inherit handles.
@@ -499,12 +504,14 @@ InspIRCd::InspIRCd(int argc, char** argv)
case 'f':
/* Log filename was set */
strlcpy(LogFileName, optarg, MAXBUF);
- printf("LOG: Setting logfile to %s\n", LogFileName);
+ if (owner_processid)
+ printf("LOG: Setting logfile to %s\n", LogFileName);
break;
case 'c':
/* Config filename was set */
strlcpy(ConfigFileName, optarg, MAXBUF);
- printf("CONFIG: Setting config file to %s\n", ConfigFileName);
+ if (owner_processid)
+ printf("CONFIG: Setting config file to %s\n", ConfigFileName);
break;
case 0:
/* getopt_long_only() set an int variable, just keep going */