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
62eda39f
Commit
62eda39f
authored
Nov 23, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Moved the create_temp_file function to mapping.c.
parent
5f808f03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
file.c
server/file.c
+1
-18
file.h
server/file.h
+1
-1
mapping.c
server/mapping.c
+17
-0
No files found.
server/file.c
View file @
62eda39f
...
...
@@ -115,7 +115,7 @@ static inline int is_overlapped( const struct file *file )
/* create a file from a file descriptor */
/* if the function fails the fd is closed */
st
atic
st
ruct
file
*
create_file_for_fd
(
int
fd
,
unsigned
int
access
,
unsigned
int
sharing
)
struct
file
*
create_file_for_fd
(
int
fd
,
unsigned
int
access
,
unsigned
int
sharing
)
{
struct
file
*
file
;
struct
stat
st
;
...
...
@@ -226,23 +226,6 @@ int is_same_file( struct file *file1, struct file *file2 )
return
is_same_file_fd
(
file1
->
fd
,
file2
->
fd
);
}
/* create a temp file for anonymous mappings */
struct
file
*
create_temp_file
(
int
access
)
{
char
tmpfn
[
16
];
int
fd
;
sprintf
(
tmpfn
,
"anonmap.XXXXXX"
);
/* create it in the server directory */
fd
=
mkstemps
(
tmpfn
,
0
);
if
(
fd
==
-
1
)
{
file_set_error
();
return
NULL
;
}
unlink
(
tmpfn
);
return
create_file_for_fd
(
fd
,
access
,
0
);
}
static
void
file_dump
(
struct
object
*
obj
,
int
verbose
)
{
struct
file
*
file
=
(
struct
file
*
)
obj
;
...
...
server/file.h
View file @
62eda39f
...
...
@@ -113,8 +113,8 @@ extern struct file *get_file_obj( struct process *process, obj_handle_t handle,
unsigned
int
access
);
extern
int
get_file_unix_fd
(
struct
file
*
file
);
extern
int
is_same_file
(
struct
file
*
file1
,
struct
file
*
file2
);
extern
struct
file
*
create_file_for_fd
(
int
fd
,
unsigned
int
access
,
unsigned
int
sharing
);
extern
struct
file
*
grab_file_unless_removable
(
struct
file
*
file
);
extern
struct
file
*
create_temp_file
(
int
access
);
extern
void
file_set_error
(
void
);
extern
struct
security_descriptor
*
mode_to_sd
(
mode_t
mode
,
const
SID
*
user
,
const
SID
*
group
);
extern
mode_t
sd_to_mode
(
const
struct
security_descriptor
*
sd
,
const
SID
*
owner
);
...
...
server/mapping.c
View file @
62eda39f
...
...
@@ -162,6 +162,23 @@ static int grow_file( int unix_fd, file_pos_t new_size )
return
0
;
}
/* create a temp file for anonymous mappings */
static
struct
file
*
create_temp_file
(
unsigned
int
access
)
{
char
tmpfn
[
16
];
int
fd
;
sprintf
(
tmpfn
,
"anonmap.XXXXXX"
);
/* create it in the server directory */
fd
=
mkstemps
(
tmpfn
,
0
);
if
(
fd
==
-
1
)
{
file_set_error
();
return
NULL
;
}
unlink
(
tmpfn
);
return
create_file_for_fd
(
fd
,
access
,
0
);
}
/* find the shared PE mapping for a given mapping */
static
struct
file
*
get_shared_file
(
struct
mapping
*
mapping
)
{
...
...
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