mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
server: Fix compile error on FreeBSD/NetBSD.
F_GETPATH is currently only implemented on macOS. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56047
This commit is contained in:
parent
2c14e0777a
commit
6b4eae4088
Notes:
Alexandre Julliard
2023-12-27 22:12:13 +01:00
Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/4744
1 changed files with 6 additions and 6 deletions
|
@ -723,18 +723,18 @@ static unsigned int filter_from_inode( struct inode *inode, int is_parent )
|
|||
|
||||
static char *get_path_from_fd( int fd, int sz )
|
||||
{
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
#ifdef linux
|
||||
char *ret = malloc( 32 + sz );
|
||||
|
||||
if (ret) sprintf( ret, "/proc/self/fd/%u", fd );
|
||||
return ret;
|
||||
#elif defined(F_GETPATH)
|
||||
char *ret = malloc( PATH_MAX + sz );
|
||||
|
||||
if (!ret) return NULL;
|
||||
if (!fcntl( fd, F_GETPATH, ret )) return ret;
|
||||
free( ret );
|
||||
return NULL;
|
||||
#elif defined(linux)
|
||||
char *ret = malloc( 32 + sz );
|
||||
|
||||
if (ret) sprintf( ret, "/proc/self/fd/%u", fd );
|
||||
return ret;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue