Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f51e696c
Commit
f51e696c
authored
Aug 02, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Support an arbitrary number of temporary files.
parent
84f40464
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
utils.c
tools/winebuild/utils.c
+8
-4
No files found.
tools/winebuild/utils.c
View file @
f51e696c
...
...
@@ -39,9 +39,9 @@
#include "build.h"
#define MAX_TMP_FILES 8
static
const
char
*
tmp_files
[
MAX_TMP_FILES
];
static
const
char
**
tmp_files
;
static
unsigned
int
nb_tmp_files
;
static
unsigned
int
max_tmp_files
;
static
const
struct
{
...
...
@@ -66,7 +66,7 @@ static const struct
static
void
cleanup_tmp_files
(
void
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
MAX_TMP_FILES
;
i
++
)
if
(
tmp_files
[
i
])
unlink
(
tmp_files
[
i
]
);
for
(
i
=
0
;
i
<
nb_tmp_files
;
i
++
)
if
(
tmp_files
[
i
])
unlink
(
tmp_files
[
i
]
);
}
...
...
@@ -348,7 +348,6 @@ char *get_temp_file_name( const char *prefix, const char *suffix )
const
char
*
ext
;
int
fd
;
assert
(
nb_tmp_files
<
MAX_TMP_FILES
);
if
(
!
nb_tmp_files
&&
!
save_temps
)
atexit
(
cleanup_tmp_files
);
if
(
!
prefix
||
!
prefix
[
0
])
prefix
=
"winebuild"
;
...
...
@@ -367,6 +366,11 @@ char *get_temp_file_name( const char *prefix, const char *suffix )
fatal_error
(
"could not generate a temp file
\n
"
);
close
(
fd
);
if
(
nb_tmp_files
>=
max_tmp_files
)
{
max_tmp_files
=
max
(
2
*
max_tmp_files
,
8
);
tmp_files
=
xrealloc
(
tmp_files
,
max_tmp_files
*
sizeof
(
tmp_files
[
0
])
);
}
tmp_files
[
nb_tmp_files
++
]
=
name
;
return
name
;
}
...
...
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