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
2f4f9ee1
Commit
2f4f9ee1
authored
May 26, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Fix the creation of temp files in /tmp.
parent
dbbed381
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
utils.c
tools/winebuild/utils.c
+15
-10
No files found.
tools/winebuild/utils.c
View file @
2f4f9ee1
...
...
@@ -410,25 +410,30 @@ const char *get_nm_command(void)
char
*
get_temp_file_name
(
const
char
*
prefix
,
const
char
*
suffix
)
{
char
*
name
;
const
char
*
ext
;
const
char
*
ext
,
*
basename
;
int
fd
;
if
(
!
nb_tmp_files
&&
!
save_temps
)
atexit
(
cleanup_tmp_files
);
if
(
!
prefix
||
!
prefix
[
0
])
prefix
=
"winebuild"
;
if
(
!
suffix
)
suffix
=
""
;
if
(
!
(
ext
=
strchr
(
prefix
,
'.'
)))
ext
=
prefix
+
strlen
(
prefix
);
if
((
basename
=
strrchr
(
prefix
,
'/'
)))
basename
++
;
else
basename
=
prefix
;
if
(
!
(
ext
=
strchr
(
basename
,
'.'
)))
ext
=
prefix
+
strlen
(
prefix
);
name
=
xmalloc
(
sizeof
(
"/tmp/"
)
+
(
ext
-
prefix
)
+
sizeof
(
".XXXXXX"
)
+
strlen
(
suffix
)
);
strcpy
(
name
,
"/tmp/"
);
memcpy
(
name
+
5
,
prefix
,
ext
-
prefix
);
strcpy
(
name
+
5
+
(
ext
-
prefix
),
".XXXXXX"
);
memcpy
(
name
,
prefix
,
ext
-
prefix
);
strcpy
(
name
+
(
ext
-
prefix
),
".XXXXXX"
);
strcat
(
name
,
suffix
);
/* first try without the /tmp/ prefix */
if
((
fd
=
mkstemps
(
name
+
5
,
strlen
(
suffix
)
))
!=
-
1
)
name
+=
5
;
else
if
((
fd
=
mkstemps
(
name
,
strlen
(
suffix
)
))
==
-
1
)
fatal_error
(
"could not generate a temp file
\n
"
);
if
((
fd
=
mkstemps
(
name
,
strlen
(
suffix
)
))
==
-
1
)
{
strcpy
(
name
,
"/tmp/"
);
memcpy
(
name
+
5
,
basename
,
ext
-
basename
);
strcpy
(
name
+
5
+
(
ext
-
basename
),
".XXXXXX"
);
strcat
(
name
,
suffix
);
if
((
fd
=
mkstemps
(
name
,
strlen
(
suffix
)
))
==
-
1
)
fatal_error
(
"could not generate a temp file
\n
"
);
}
close
(
fd
);
if
(
nb_tmp_files
>=
max_tmp_files
)
...
...
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