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
786d2490
Commit
786d2490
authored
Jul 29, 2002
by
Marcus Meissner
Committed by
Alexandre Julliard
Jul 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for mkstemp, added a port implementation if it is not
present. Use mkstemp() in various places needing tmp files.
parent
6ecade7c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
20 deletions
+69
-20
configure
configure
+2
-0
configure.ac
configure.ac
+1
-0
gdbproxy.c
debugger/gdbproxy.c
+5
-1
shelllink.c
dlls/shell32/shelllink.c
+10
-2
config.h.in
include/config.h.in
+3
-0
port.h
include/wine/port.h
+4
-0
port.c
library/port.c
+29
-0
file.c
server/file.c
+4
-11
wpp.c
tools/wpp/wpp.c
+11
-6
No files found.
configure
View file @
786d2490
...
...
@@ -11199,6 +11199,7 @@ fi
for
ac_func
in
\
__libc_fork
\
_lwp_create
\
...
...
@@ -11226,6 +11227,7 @@ for ac_func in \
lseek64
\
lstat
\
memmove
\
mkstemp
\
mmap
\
pclose
\
popen
\
...
...
configure.ac
View file @
786d2490
...
...
@@ -879,6 +879,7 @@ AC_CHECK_FUNCS(\
lseek64 \
lstat \
memmove \
mkstemp \
mmap \
pclose \
popen \
...
...
debugger/gdbproxy.c
View file @
786d2490
...
...
@@ -1812,11 +1812,15 @@ static BOOL gdb_startup(struct gdb_context* gdbctx, DEBUG_EVENT* de, unsigned fl
case
0
:
/* in child... and alive */
{
char
buf
[
MAX_PATH
];
int
fd
;
char
*
gdb_path
;
FILE
*
f
;
if
(
!
(
gdb_path
=
getenv
(
"WINE_GDB"
)))
gdb_path
=
"gdb"
;
if
(
!
tmpnam
(
buf
)
||
(
f
=
fopen
(
buf
,
"w+"
))
==
NULL
)
return
FALSE
;
strcpy
(
buf
,
"/tmp/winegdb.XXXXXX"
);
fd
=
mkstemp
(
buf
);
if
(
fd
==
-
1
)
return
FALSE
;
if
((
f
=
fdopen
(
fd
,
"w+"
))
==
NULL
)
return
FALSE
;
fprintf
(
f
,
"file %s
\n
"
,
wine_path
);
fprintf
(
f
,
"target remote localhost:%d
\n
"
,
ntohs
(
s_addr
.
sin_port
));
fprintf
(
f
,
"monitor trace=0
\n
"
);
...
...
dlls/shell32/shelllink.c
View file @
786d2490
...
...
@@ -28,6 +28,7 @@
# include <sys/wait.h>
#endif
#include "wine/debug.h"
#include "wine/port.h"
#include "winerror.h"
#include "winbase.h"
#include "winnls.h"
...
...
@@ -551,8 +552,15 @@ static BOOL create_default_icon( const char *filename )
/* extract an icon from an exe or icon file; helper for IPersistFile_fnSave */
static
char
*
extract_icon
(
const
char
*
path
,
int
index
)
{
int
nodefault
=
1
;
char
*
filename
=
heap_strdup
(
tmpnam
(
NULL
)
);
int
fd
,
nodefault
=
1
;
char
*
filename
,
tmpfn
[
25
];
strcpy
(
tmpfn
,
"/tmp/icon.XXXXXX"
);
fd
=
mkstemp
(
tmpfn
);
if
(
fd
==
-
1
)
return
NULL
;
filename
=
heap_strdup
(
tmpfn
);
close
(
fd
);
/* not needed */
/* If icon path begins with a '*' then this is a deferred call */
if
(
path
[
0
]
==
'*'
)
...
...
include/config.h.in
View file @
786d2490
...
...
@@ -290,6 +290,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
...
...
include/wine/port.h
View file @
786d2490
...
...
@@ -222,6 +222,10 @@ unsigned long inet_network(const char *cp);
int
lstat
(
const
char
*
file_name
,
struct
stat
*
buf
);
#endif
/* HAVE_LSTAT */
#ifndef HAVE_MKSTEMP
int
mkstemp
(
char
*
tmpfn
);
#endif
/* HAVE_MKSTEMP */
#ifndef HAVE_MEMMOVE
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
unsigned
int
len
);
#endif
/* !defined(HAVE_MEMMOVE) */
...
...
library/port.c
View file @
786d2490
...
...
@@ -340,6 +340,35 @@ int lstat(const char *file_name, struct stat *buf)
}
#endif
/* HAVE_LSTAT */
/***********************************************************************
* mkstemp
*/
#ifndef HAVE_MKSTEMP
int
mkstemp
(
char
*
tmpfn
)
{
int
tries
;
char
*
xstart
;
xstart
=
tmpfn
+
strlen
(
tmpfn
)
-
1
;
while
((
xstart
>
tmpfn
)
&&
(
*
xstart
==
'X'
))
xstart
--
;
tries
=
10
;
while
(
tries
--
)
{
char
*
newfn
=
mktemp
(
tmpfn
);
int
fd
;
if
(
!
newfn
)
/* something else broke horribly */
return
-
1
;
fd
=
open
(
newfn
,
O_CREAT
|
O_RDWR
|
O_EXCL
,
0600
);
if
(
fd
!=-
1
)
return
fd
;
newfn
=
xstart
;
/* fill up with X and try again ... */
while
(
*
newfn
)
*
newfn
++
=
'X'
;
}
return
-
1
;
}
#endif
/* HAVE_MKSTEMP */
/***********************************************************************
* pread
...
...
server/file.c
View file @
786d2490
...
...
@@ -230,24 +230,17 @@ int get_file_drive_type( struct file *file )
/* Create an anonymous Unix file */
int
create_anonymous_file
(
void
)
{
char
*
name
;
char
tmpfn
[
21
]
;
int
fd
;
do
{
if
(
!
(
name
=
tmpnam
(
NULL
)))
{
set_error
(
STATUS_TOO_MANY_OPENED_FILES
);
return
-
1
;
}
fd
=
open
(
name
,
O_CREAT
|
O_EXCL
|
O_RDWR
,
0600
);
}
while
((
fd
==
-
1
)
&&
(
errno
==
EEXIST
));
sprintf
(
tmpfn
,
"/tmp/anonmap.XXXXXX"
);
fd
=
mkstemp
(
tmpfn
);
if
(
fd
==
-
1
)
{
file_set_error
();
return
-
1
;
}
unlink
(
name
);
unlink
(
tmpfn
);
return
fd
;
}
...
...
tools/wpp/wpp.c
View file @
786d2490
...
...
@@ -19,6 +19,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <time.h>
#include <stdlib.h>
...
...
@@ -109,20 +112,22 @@ int wpp_parse( const char *input, FILE *output )
/* parse into a temporary file */
int
wpp_parse_temp
(
const
char
*
input
,
char
**
output_name
)
{
char
*
temp_name
;
FILE
*
output
;
int
ret
;
int
ret
,
fd
;
char
tmpfn
[
20
],
*
temp_name
;
strcpy
(
tmpfn
,
"/tmp/wpp.XXXXXX"
);
if
(
!
(
temp_name
=
tmpnam
(
NULL
))
)
if
(
(
fd
=
mkstemp
(
tmpfn
))
==
-
1
)
{
fprintf
(
stderr
,
"Could not generate a temp-name
\n
"
);
exit
(
2
);
}
temp_name
=
pp_xstrdup
(
t
emp_name
);
temp_name
=
pp_xstrdup
(
t
mpfn
);
if
(
!
(
output
=
f
open
(
temp_name
,
"wt"
)))
if
(
!
(
output
=
f
dopen
(
fd
,
"wt"
)))
{
fprintf
(
stderr
,
"Could not open %s for writing
\n
"
,
temp_name
);
fprintf
(
stderr
,
"Could not open
fd
%s for writing
\n
"
,
temp_name
);
exit
(
2
);
}
...
...
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