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
f935b514
Commit
f935b514
authored
May 19, 2005
by
Juan Lang
Committed by
Alexandre Julliard
May 19, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement get_default_drive_device for FreeBSD.
parent
e18ca988
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
directory.c
dlls/ntdll/directory.c
+49
-0
No files found.
dlls/ntdll/directory.c
View file @
f935b514
...
...
@@ -276,6 +276,27 @@ static char *parse_mount_entries( FILE *f, dev_t dev, ino_t ino )
}
#endif
#ifdef __FreeBSD__
#include <fstab.h>
static
char
*
parse_mount_entries
(
FILE
*
f
,
dev_t
dev
,
ino_t
ino
)
{
struct
fstab
*
entry
;
struct
stat
st
;
while
((
entry
=
getfsent
()))
{
/* don't even bother stat'ing network mounts, there's no meaningful device anyway */
if
(
!
strcmp
(
entry
->
fs_vfstype
,
"nfs"
)
||
!
strcmp
(
entry
->
fs_vfstype
,
"smbfs"
)
||
!
strcmp
(
entry
->
fs_vfstype
,
"ncpfs"
))
continue
;
if
(
stat
(
entry
->
fs_file
,
&
st
)
==
-
1
)
continue
;
if
(
st
.
st_dev
!=
dev
||
st
.
st_ino
!=
ino
)
continue
;
return
entry
->
fs_spec
;
}
}
#endif
#ifdef sun
#include <sys/mnttab.h>
static
char
*
parse_mount_entries
(
FILE
*
f
,
dev_t
dev
,
ino_t
ino
)
...
...
@@ -357,6 +378,34 @@ static char *get_default_drive_device( const char *root )
}
RtlLeaveCriticalSection
(
&
dir_section
);
#elif defined( __FreeBSD__ )
char
*
device
=
NULL
;
int
fd
,
res
=
-
1
;
struct
stat
st
;
/* try to open it first to force it to get mounted */
if
((
fd
=
open
(
root
,
O_RDONLY
))
!=
-
1
)
{
res
=
fstat
(
fd
,
&
st
);
close
(
fd
);
}
/* now try normal stat just in case */
if
(
res
==
-
1
)
res
=
stat
(
root
,
&
st
);
if
(
res
==
-
1
)
return
NULL
;
RtlEnterCriticalSection
(
&
dir_section
);
/* The FreeBSD parse_mount_entries doesn't require a file argument, so just
* pass NULL. Leave the argument in for symmetry.
*/
device
=
parse_mount_entries
(
NULL
,
st
.
st_dev
,
st
.
st_ino
);
if
(
device
)
{
ret
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
strlen
(
device
)
+
1
);
if
(
ret
)
strcpy
(
ret
,
device
);
}
RtlLeaveCriticalSection
(
&
dir_section
);
#elif defined( sun )
FILE
*
f
;
char
*
device
=
NULL
;
...
...
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