Alexandre Julliard : server: Moved the create_temp_file function to mapping .c.

Alexandre Julliard julliard at winehq.org
Tue Nov 24 12:40:20 CST 2009


Module: wine
Branch: master
Commit: 62eda39fc19589140bca432042b888ed4ffb149e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=62eda39fc19589140bca432042b888ed4ffb149e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Nov 23 16:20:15 2009 +0100

server: Moved the create_temp_file function to mapping.c.

---

 server/file.c    |   19 +------------------
 server/file.h    |    2 +-
 server/mapping.c |   17 +++++++++++++++++
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/server/file.c b/server/file.c
index 01fefdb..c09ddc5 100644
--- a/server/file.c
+++ b/server/file.c
@@ -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 */
-static struct 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;
diff --git a/server/file.h b/server/file.h
index 27aed39..1ace6f7 100644
--- a/server/file.h
+++ b/server/file.h
@@ -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 );
diff --git a/server/mapping.c b/server/mapping.c
index e3f69a8..b6211bf 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -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 )
 {




More information about the wine-cvs mailing list