summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-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: