diff --git a/src/modules/welcome/checker/partman_devices.c b/src/modules/welcome/checker/partman_devices.c index 98d50fd9c..c07eef460 100644 --- a/src/modules/welcome/checker/partman_devices.c +++ b/src/modules/welcome/checker/partman_devices.c @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * Copyright 2014, Teo Mrnjavac + * Copyright 2014-2015, Teo Mrnjavac * * Based on parted_devices.c, from partman-base. * @@ -48,8 +48,11 @@ is_cdrom(const char *path) int ret; fd = open(path, O_RDONLY | O_NONBLOCK); - ret = ioctl(fd, CDROM_GET_CAPABILITY, NULL); - close(fd); + if (fd >= 0) + { + ret = ioctl(fd, CDROM_GET_CAPABILITY, NULL); + close(fd); + } if (ret >= 0) return 1;