Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4e07d0d6
Commit
4e07d0d6
authored
May 27, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make_ctests: Clean output files when aborting on an error or signal.
parent
411fe29a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
make_ctests.c
tools/make_ctests.c
+19
-1
No files found.
tools/make_ctests.c
View file @
4e07d0d6
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "config.h"
#include "config.h"
#include <signal.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -34,6 +35,16 @@
...
@@ -34,6 +35,16 @@
static
const
char
*
output_file
;
static
const
char
*
output_file
;
static
void
cleanup_files
(
void
)
{
if
(
output_file
)
unlink
(
output_file
);
}
static
void
exit_on_signal
(
int
sig
)
{
exit
(
1
);
/* this will call the atexit functions */
}
static
void
fatal_error
(
const
char
*
msg
,
...
)
static
void
fatal_error
(
const
char
*
msg
,
...
)
{
{
va_list
valist
;
va_list
valist
;
...
@@ -41,7 +52,6 @@ static void fatal_error( const char *msg, ... )
...
@@ -41,7 +52,6 @@ static void fatal_error( const char *msg, ... )
fprintf
(
stderr
,
"make_ctests: "
);
fprintf
(
stderr
,
"make_ctests: "
);
vfprintf
(
stderr
,
msg
,
valist
);
vfprintf
(
stderr
,
msg
,
valist
);
va_end
(
valist
);
va_end
(
valist
);
if
(
output_file
)
unlink
(
output_file
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -108,6 +118,13 @@ int main( int argc, const char** argv )
...
@@ -108,6 +118,13 @@ int main( int argc, const char** argv )
tests
[
count
++
]
=
basename
(
argv
[
i
]
);
tests
[
count
++
]
=
basename
(
argv
[
i
]
);
}
}
atexit
(
cleanup_files
);
signal
(
SIGTERM
,
exit_on_signal
);
signal
(
SIGINT
,
exit_on_signal
);
#ifdef SIGHUP
signal
(
SIGHUP
,
exit_on_signal
);
#endif
if
(
output_file
)
if
(
output_file
)
{
{
if
(
!
(
out
=
fopen
(
output_file
,
"w"
)))
if
(
!
(
out
=
fopen
(
output_file
,
"w"
)))
...
@@ -138,5 +155,6 @@ int main( int argc, const char** argv )
...
@@ -138,5 +155,6 @@ int main( int argc, const char** argv )
if
(
output_file
&&
fclose
(
out
))
if
(
output_file
&&
fclose
(
out
))
fatal_perror
(
"error writing to %s"
,
output_file
);
fatal_perror
(
"error writing to %s"
,
output_file
);
output_file
=
NULL
;
return
0
;
return
0
;
}
}
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