summaryrefslogtreecommitdiffstats
path: root/perl-install/c/stuff.xs.pl
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-08-14 02:16:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-08-14 02:16:24 +0000
commit8108ca972d666fdf063cd13f23c08fdb481327d0 (patch)
tree32250513818ede34384739199105f371acb90d1c /perl-install/c/stuff.xs.pl
parent8f4cdfe6f9ac1e825dfbb64c92ef37da4d26ab97 (diff)
downloaddrakx-8108ca972d666fdf063cd13f23c08fdb481327d0.tar
drakx-8108ca972d666fdf063cd13f23c08fdb481327d0.tar.gz
drakx-8108ca972d666fdf063cd13f23c08fdb481327d0.tar.bz2
drakx-8108ca972d666fdf063cd13f23c08fdb481327d0.tar.xz
drakx-8108ca972d666fdf063cd13f23c08fdb481327d0.zip
in floppy_info(), check ioctl success and use FDPOLLDRVSTAT (copied from kudzu code)
Diffstat (limited to 'perl-install/c/stuff.xs.pl')
-rw-r--r--perl-install/c/stuff.xs.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index 8111f2eba..497d60c19 100644
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -289,8 +289,11 @@ floppy_info(name)
RETVAL = NULL;
if (fd != -1) {
char drivtyp[17];
- ioctl(fd, FDGETDRVTYP, (void *)drivtyp);
- RETVAL = drivtyp;
+ if (ioctl(fd, FDGETDRVTYP, (void *)drivtyp) == 0) {
+ struct floppy_drive_struct ds;
+ if (ioctl(fd, FDPOLLDRVSTAT, &ds) == 0 && ds.track >= 0)
+ RETVAL = drivtyp;
+ }
close(fd);
}
OUTPUT: