Update upstream source from tag 'upstream/21.80'
Update to upstream version '21.80'
with Debian dir 2d7ad8f32c83d485eadd94982592e23f9e830026
Tomasz Buchert
2 years ago
1277 | 1277 | |
1278 | 1278 | ci = hd->detail->cdrom.data; |
1279 | 1279 | |
1280 | hd->is.notready = 1; | |
1281 | ||
1282 | if((fd = open(hd->unix_dev_name, O_RDONLY|O_NONBLOCK)) > 0) { | |
1283 | /* we get CDS_DISK_OK if there is CD in the drive */ | |
1284 | ioctl(fd, CDROM_DRIVE_STATUS, 0) == CDS_DISC_OK ? hd->is.notready = 0 : NULL; | |
1280 | fd = open(hd->unix_dev_name, O_RDONLY|O_NONBLOCK); | |
1281 | ||
1282 | /* we get CDS_DISK_OK if there is a CD in the drive */ | |
1283 | hd->is.notready = fd != -1 && ioctl(fd, CDROM_DRIVE_STATUS, 0) == CDS_DISC_OK ? 0 : 1; | |
1284 | ||
1285 | if(hd->is.notready) { | |
1286 | if(fd != -1) close(fd); | |
1285 | 1287 | return NULL; |
1286 | 1288 | } |
1287 | 1289 |