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
bfec8c22
Commit
bfec8c22
authored
May 14, 2005
by
Robert Lunnon
Committed by
Alexandre Julliard
May 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement get_default_drive_device for Solaris.
parent
e510a291
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
directory.c
dlls/ntdll/directory.c
+109
-0
No files found.
dlls/ntdll/directory.c
View file @
bfec8c22
...
...
@@ -208,6 +208,42 @@ static char *get_default_lpt_device( int num )
*
* Parse mount entries looking for a given device. Helper for get_default_drive_device.
*/
#ifdef sun
#include <sys/vfstab.h>
static
char
*
parse_vfstab_entries
(
FILE
*
f
,
dev_t
dev
,
ino_t
ino
)
{
struct
vfstab
vfs_entry
;
struct
vfstab
*
entry
=&
vfs_entry
;
struct
stat
st
;
char
*
device
;
while
(
!
getvfsent
(
f
,
entry
))
{
/* don't even bother stat'ing network mounts, there's no meaningful device anyway */
if
(
!
strcmp
(
entry
->
vfs_fstype
,
"nfs"
)
||
!
strcmp
(
entry
->
vfs_fstype
,
"smbfs"
)
||
!
strcmp
(
entry
->
vfs_fstype
,
"ncpfs"
))
continue
;
if
(
stat
(
entry
->
vfs_mountp
,
&
st
)
==
-
1
)
continue
;
if
(
st
.
st_dev
!=
dev
||
st
.
st_ino
!=
ino
)
continue
;
if
(
!
strcmp
(
entry
->
vfs_fstype
,
"fd"
))
{
if
((
device
=
strstr
(
entry
->
vfs_mntopts
,
"dev="
)))
{
char
*
p
=
strchr
(
device
+
4
,
','
);
if
(
p
)
*
p
=
0
;
return
device
+
4
;
}
}
else
return
entry
->
vfs_special
;
}
return
NULL
;
}
#endif
#ifdef linux
static
char
*
parse_mount_entries
(
FILE
*
f
,
dev_t
dev
,
ino_t
ino
)
{
...
...
@@ -240,6 +276,42 @@ static char *parse_mount_entries( FILE *f, dev_t dev, ino_t ino )
}
#endif
#ifdef sun
#include <sys/mnttab.h>
static
char
*
parse_mount_entries
(
FILE
*
f
,
dev_t
dev
,
ino_t
ino
)
{
volatile
struct
mnttab
mntentry
;
struct
mnttab
*
entry
=&
mntentry
;
struct
stat
st
;
char
*
device
;
while
((
!
getmntent
(
f
,
entry
)
))
{
/* don't even bother stat'ing network mounts, there's no meaningful device anyway */
if
(
!
strcmp
(
entry
->
mnt_fstype
,
"nfs"
)
||
!
strcmp
(
entry
->
mnt_fstype
,
"smbfs"
)
||
!
strcmp
(
entry
->
mnt_fstype
,
"ncpfs"
))
continue
;
if
(
stat
(
entry
->
mnt_mountp
,
&
st
)
==
-
1
)
continue
;
if
(
st
.
st_dev
!=
dev
||
st
.
st_ino
!=
ino
)
continue
;
if
(
!
strcmp
(
entry
->
mnt_fstype
,
"fd"
))
{
if
((
device
=
strstr
(
entry
->
mnt_mntopts
,
"dev="
)))
{
char
*
p
=
strchr
(
device
+
4
,
','
);
if
(
p
)
*
p
=
0
;
return
device
+
4
;
}
}
else
return
entry
->
mnt_special
;
}
return
NULL
;
}
#endif
/***********************************************************************
* get_default_drive_device
*
...
...
@@ -284,6 +356,43 @@ static char *get_default_drive_device( const char *root )
if
(
ret
)
strcpy
(
ret
,
device
);
}
RtlLeaveCriticalSection
(
&
dir_section
);
#elif defined( sun )
FILE
*
f
;
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
);
if
((
f
=
fopen
(
"/etc/mnttab"
,
"r"
)))
{
device
=
parse_mount_entries
(
f
,
st
.
st_dev
,
st
.
st_ino
);
fclose
(
f
);
}
/* look through fstab too in case it's not mounted (for instance if it's an audio CD) */
if
(
!
device
&&
(
f
=
fopen
(
"/etc/vfstab"
,
"r"
)))
{
device
=
parse_vfstab_entries
(
f
,
st
.
st_dev
,
st
.
st_ino
);
fclose
(
f
);
}
if
(
device
)
{
ret
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
strlen
(
device
)
+
1
);
if
(
ret
)
strcpy
(
ret
,
device
);
}
RtlLeaveCriticalSection
(
&
dir_section
);
#elif defined(__APPLE__)
struct
statfs
*
mntStat
;
struct
stat
st
;
...
...
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