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
c1c3691b
Commit
c1c3691b
authored
Aug 04, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Move gethostname() to the Unix library.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
61b123fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
protocol.c
dlls/ws2_32/protocol.c
+9
-7
unixlib.c
dlls/ws2_32/unixlib.c
+10
-0
ws2_32_private.h
dlls/ws2_32/ws2_32_private.h
+1
-0
No files found.
dlls/ws2_32/protocol.c
View file @
c1c3691b
...
...
@@ -913,6 +913,7 @@ struct WS_hostent * WINAPI WS_gethostbyname( const char *name )
{
struct
WS_hostent
*
host
=
NULL
;
char
hostname
[
100
];
int
ret
;
TRACE
(
"%s
\n
"
,
debugstr_a
(
name
)
);
...
...
@@ -922,9 +923,9 @@ struct WS_hostent * WINAPI WS_gethostbyname( const char *name )
return
NULL
;
}
if
(
gethostname
(
hostname
,
100
)
==
-
1
)
if
(
(
ret
=
unix_funcs
->
gethostname
(
hostname
,
100
))
)
{
SetLastError
(
WSAENOBUFS
);
SetLastError
(
ret
);
return
NULL
;
}
...
...
@@ -973,7 +974,7 @@ struct WS_hostent * WINAPI WS_gethostbyname( const char *name )
int
WINAPI
WS_gethostname
(
char
*
name
,
int
namelen
)
{
char
buf
[
256
];
int
len
;
int
len
,
ret
;
TRACE
(
"name %p, len %d
\n
"
,
name
,
namelen
);
...
...
@@ -983,9 +984,9 @@ int WINAPI WS_gethostname( char *name, int namelen )
return
-
1
;
}
if
(
gethostname
(
buf
,
sizeof
(
buf
)
)
!=
0
)
if
(
(
ret
=
unix_funcs
->
gethostname
(
buf
,
sizeof
(
buf
)
))
)
{
SetLastError
(
sock_get_error
(
errno
)
);
SetLastError
(
ret
);
return
-
1
;
}
...
...
@@ -1009,6 +1010,7 @@ int WINAPI WS_gethostname( char *name, int namelen )
int
WINAPI
GetHostNameW
(
WCHAR
*
name
,
int
namelen
)
{
char
buf
[
256
];
int
ret
;
TRACE
(
"name %p, len %d
\n
"
,
name
,
namelen
);
...
...
@@ -1018,9 +1020,9 @@ int WINAPI GetHostNameW( WCHAR *name, int namelen )
return
-
1
;
}
if
(
gethostname
(
buf
,
sizeof
(
buf
)
))
if
(
(
ret
=
unix_funcs
->
gethostname
(
buf
,
sizeof
(
buf
)
)
))
{
SetLastError
(
sock_get_error
(
errno
)
);
SetLastError
(
ret
);
return
-
1
;
}
...
...
dlls/ws2_32/unixlib.c
View file @
c1c3691b
...
...
@@ -30,6 +30,7 @@
#include <errno.h>
#include <pthread.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
...
...
@@ -789,11 +790,20 @@ static int CDECL unix_gethostbyname( const char *name, struct WS_hostent *const
#endif
static
int
CDECL
unix_gethostname
(
char
*
name
,
int
len
)
{
if
(
!
gethostname
(
name
,
len
))
return
0
;
return
errno_from_unix
(
errno
);
}
static
const
struct
unix_funcs
funcs
=
{
unix_getaddrinfo
,
unix_gethostbyaddr
,
unix_gethostbyname
,
unix_gethostname
,
};
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
...
...
dlls/ws2_32/ws2_32_private.h
View file @
c1c3691b
...
...
@@ -203,6 +203,7 @@ struct unix_funcs
int
(
CDECL
*
gethostbyaddr
)(
const
void
*
addr
,
int
len
,
int
family
,
struct
WS
(
hostent
)
*
host
,
unsigned
int
*
size
);
int
(
CDECL
*
gethostbyname
)(
const
char
*
name
,
struct
WS
(
hostent
)
*
host
,
unsigned
int
*
size
);
int
(
CDECL
*
gethostname
)(
char
*
name
,
int
len
);
};
extern
const
struct
unix_funcs
*
unix_funcs
;
...
...
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