Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ac24236d
Commit
ac24236d
authored
Apr 22, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 22, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always close fd when reading super block.
parent
493e9d7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
drive.c
files/drive.c
+23
-7
No files found.
files/drive.c
View file @
ac24236d
...
...
@@ -521,6 +521,7 @@ int DRIVE_ReadSuperblock (int drive, char * buff)
#define DRIVE_SUPER 96
int
fd
;
off_t
offs
;
int
ret
=
0
;
if
(
memset
(
buff
,
0
,
DRIVE_SUPER
)
!=
buff
)
return
-
1
;
if
((
fd
=
open
(
DOSDrives
[
drive
].
device
,
O_RDONLY
))
==
-
1
)
...
...
@@ -551,8 +552,16 @@ int DRIVE_ReadSuperblock (int drive, char * buff)
break
;
}
if
((
offs
)
&&
(
lseek
(
fd
,
offs
,
SEEK_SET
)
!=
offs
))
return
-
4
;
if
(
read
(
fd
,
buff
,
DRIVE_SUPER
)
!=
DRIVE_SUPER
)
return
-
2
;
if
((
offs
)
&&
(
lseek
(
fd
,
offs
,
SEEK_SET
)
!=
offs
))
{
ret
=
-
4
;
goto
the_end
;
}
if
(
read
(
fd
,
buff
,
DRIVE_SUPER
)
!=
DRIVE_SUPER
)
{
ret
=
-
2
;
goto
the_end
;
}
switch
(
DOSDrives
[
drive
].
type
)
{
...
...
@@ -565,20 +574,27 @@ int DRIVE_ReadSuperblock (int drive, char * buff)
{
ERR
(
"The filesystem is not FAT !! (device=%s)
\n
"
,
DOSDrives
[
drive
].
device
);
return
-
3
;
ret
=
-
3
;
goto
the_end
;
}
break
;
case
DRIVE_CDROM
:
if
(
strncmp
(
&
buff
[
1
],
"CD001"
,
5
))
/* Check for iso9660 present */
return
-
3
;
{
ret
=
-
3
;
goto
the_end
;
}
/* FIXME: do we need to check for "CDROM", too ? (high sierra) */
break
;
break
;
default:
return
-
3
;
break
;
ret
=
-
3
;
goto
the_end
;
}
return
close
(
fd
);
the_end:
close
(
fd
);
return
ret
;
}
...
...
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