From 8108ca972d666fdf063cd13f23c08fdb481327d0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 14 Aug 2003 02:16:24 +0000 Subject: in floppy_info(), check ioctl success and use FDPOLLDRVSTAT (copied from kudzu code) --- perl-install/c/stuff.xs.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'perl-install/c/stuff.xs.pl') 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: -- cgit v1.2.1