Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
cffb7601
Commit
cffb7601
authored
Nov 21, 2011
by
Duncan Coutts
Committed by
Ian Lynagh
Nov 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop ".exe" exetention from eventlog file name
Fixes ticket
#5472
parent
7b594a5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
rts/eventlog/EventLog.c
rts/eventlog/EventLog.c
+18
-3
No files found.
rts/eventlog/EventLog.c
View file @
cffb7601
...
...
@@ -196,8 +196,22 @@ initEventLogging(void)
{
StgWord8
t
,
c
;
nat
n_caps
;
char
*
prog
;
event_log_filename
=
stgMallocBytes
(
strlen
(
prog_name
)
prog
=
stgMallocBytes
(
strlen
(
prog_name
)
+
1
,
"initEventLogging"
);
strcpy
(
prog
,
prog_name
);
#ifdef mingw32_HOST_OS
// on Windows, drop the .exe suffix if there is one
{
char
*
suff
;
suff
=
strrchr
(
prog
,
'.'
);
if
(
suff
!=
NULL
&&
!
strcmp
(
suff
,
".exe"
))
{
*
suff
=
'\0'
;
}
}
#endif
event_log_filename
=
stgMallocBytes
(
strlen
(
prog
)
+
10
/* .%d */
+
10
/* .eventlog */
,
"initEventLogging"
);
...
...
@@ -208,14 +222,15 @@ initEventLogging(void)
if
(
event_log_pid
==
-
1
)
{
// #4512
// Single process
sprintf
(
event_log_filename
,
"%s.eventlog"
,
prog
_name
);
sprintf
(
event_log_filename
,
"%s.eventlog"
,
prog
);
event_log_pid
=
getpid
();
}
else
{
// Forked process, eventlog already started by the parent
// before fork
event_log_pid
=
getpid
();
sprintf
(
event_log_filename
,
"%s.%d.eventlog"
,
prog
_name
,
event_log_pid
);
sprintf
(
event_log_filename
,
"%s.%d.eventlog"
,
prog
,
event_log_pid
);
}
stgFree
(
prog
);
/* Open event log file for writing. */
if
((
event_log_file
=
fopen
(
event_log_filename
,
"wb"
))
==
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment