Module: wine Branch: master Commit: 2330a5860aef9d767afe4db48ab42cf3155abb55 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2330a5860aef9d767afe4db48...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Apr 5 13:18:39 2021 +0200
ntdll: Stop exporting wine_server_send_fd() and wine_server_release_fd().
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/ntdll.spec | 2 -- dlls/ntdll/unix/server.c | 11 +---------- dlls/ntdll/unix/unix_private.h | 3 ++- dlls/ws2_32/socket.c | 12 ++++++------ include/wine/server.h | 2 -- 5 files changed, 9 insertions(+), 21 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index cbb45f50dff..881b57eb80a 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1603,8 +1603,6 @@ @ cdecl -syscall -norelay wine_server_call(ptr) @ cdecl -syscall wine_server_fd_to_handle(long long long ptr) @ cdecl -syscall wine_server_handle_to_fd(long long ptr ptr) -@ cdecl -syscall wine_server_release_fd(long long) -@ cdecl -syscall wine_server_send_fd(long) @ cdecl -syscall __wine_make_process_system()
# Unix interface diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 50d89f79c0d..65863f54c4b 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -797,7 +797,7 @@ unsigned int server_queue_process_apc( HANDLE process, const apc_call_t *call, a * * Send a file descriptor to the server. */ -void CDECL wine_server_send_fd( int fd ) +void wine_server_send_fd( int fd ) { struct send_fd data; struct msghdr msghdr; @@ -1120,15 +1120,6 @@ NTSTATUS CDECL wine_server_handle_to_fd( HANDLE handle, unsigned int access, int }
-/*********************************************************************** - * wine_server_release_fd - */ -void CDECL wine_server_release_fd( HANDLE handle, int unix_fd ) -{ - close( unix_fd ); -} - - /*********************************************************************** * server_pipe * diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index c02a8f50b24..257566ce976 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -164,7 +164,8 @@ extern unsigned int server_queue_process_apc( HANDLE process, const apc_call_t * apc_result_t *result ) DECLSPEC_HIDDEN; extern int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd, int *needs_close, enum server_fd_type *type, unsigned int *options ) DECLSPEC_HIDDEN; -extern void process_exit_wrapper( int status ) DECLSPEC_HIDDEN; +extern void wine_server_send_fd( int fd ) DECLSPEC_HIDDEN; +extern void process_exit_wrapper( int status ) DECLSPEC_HIDDEN; extern size_t server_init_process(void) DECLSPEC_HIDDEN; extern void server_init_process_done(void) DECLSPEC_HIDDEN; extern void server_init_thread( void *entry_point, BOOL *suspend ) DECLSPEC_HIDDEN; diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 715c96097fc..4f26d6475aa 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1298,7 +1298,7 @@ static inline int get_sock_fd( SOCKET s, DWORD access, unsigned int *options )
static inline void release_sock_fd( SOCKET s, int fd ) { - wine_server_release_fd( SOCKET2HANDLE(s), fd ); + close( fd ); }
static void _enable_event( HANDLE s, unsigned int event, @@ -2450,7 +2450,7 @@ static NTSTATUS WS2_async_recv( void *user, IO_STATUS_BLOCK *iosb, NTSTATUS stat break;
result = WS2_recv( fd, wsa, convert_flags(wsa->flags) ); - wine_server_release_fd( wsa->hSocket, fd ); + close( fd ); if (result >= 0) { status = STATUS_SUCCESS; @@ -2581,7 +2581,7 @@ static NTSTATUS WS2_async_send( void *user, IO_STATUS_BLOCK *iosb, NTSTATUS stat
/* check to see if the data is ready (non-blocking) */ result = WS2_send( fd, wsa, convert_flags(wsa->flags) ); - wine_server_release_fd( wsa->hSocket, fd ); + close( fd );
if (result >= 0) { @@ -2633,7 +2633,7 @@ static NTSTATUS WS2_async_shutdown( void *user, IO_STATUS_BLOCK *iosb, NTSTATUS case ASYNC_TYPE_WRITE: err = shutdown( fd, 1 ); break; } status = err ? wsaErrStatus() : STATUS_SUCCESS; - wine_server_release_fd( wsa->hSocket, fd ); + close( fd ); break; } iosb->u.Status = status; @@ -2804,7 +2804,7 @@ static NTSTATUS WS2_ReadFile(HANDLE hFile, PIO_STATUS_BLOCK io_status, char* buf else status = STATUS_PENDING;
- wine_server_release_fd( hFile, unix_handle ); + close( unix_handle ); TRACE("= 0x%08x (%d)\n", status, result); if (status == STATUS_SUCCESS || status == STATUS_END_OF_FILE) { @@ -2929,7 +2929,7 @@ static NTSTATUS WS2_async_transmitfile( void *user, IO_STATUS_BLOCK *iosb, NTSTA if (!(status = wine_server_handle_to_fd( wsa->write.hSocket, FILE_WRITE_DATA, &fd, NULL ))) { status = WS2_transmitfile_base( fd, wsa ); - wine_server_release_fd( wsa->write.hSocket, fd ); + close( fd ); } if (status == STATUS_PENDING) return status; diff --git a/include/wine/server.h b/include/wine/server.h index ac5dcc6f8bc..57bcdbbb00d 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -50,10 +50,8 @@ struct __server_request_info };
extern unsigned int CDECL wine_server_call( void *req_ptr ); -extern void CDECL wine_server_send_fd( int fd ); extern int CDECL wine_server_fd_to_handle( int fd, unsigned int access, unsigned int attributes, HANDLE *handle ); extern int CDECL wine_server_handle_to_fd( HANDLE handle, unsigned int access, int *unix_fd, unsigned int *options ); -extern void CDECL wine_server_release_fd( HANDLE handle, int unix_fd );
/* do a server call and set the last error code */ static inline unsigned int wine_server_call_err( void *req_ptr )