+2008-05-05 Christian Franke <franke@computer.org>
+
+ * util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]:
+ Add Cygwin device names.
+ (get_ide_disk_name) [__CYGWIN__]: Likewise.
+ (get_scsi_disk_name) [__CYGWIN__]: Likewise.
+ (check_device): Return error instead of success on empty name.
+ (make_device_map): Move label inside linux specific code to
+ prevent compiler warning.
+
2008-04-30 Robert Millan <rmh@aybabtu.com>
Based on patch from Fabian Greffrath <greffrath@leat.rub.de>
#elif defined(__QNXNTO__)
/* QNX RTP */
sprintf (name, "/dev/fd%d", unit);
+#elif defined(__CYGWIN__)
+ /* Cygwin */
+ sprintf (name, "/dev/fd%d", unit);
#else
# warning "BIOS floppy drives cannot be guessed in your operating system."
/* Set NAME to a bogus string. */
/* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could
contain SCSI disks. */
sprintf (name, "/dev/hd%d", unit);
+#elif defined(__CYGWIN__)
+ /* Cygwin emulates all disks as /dev/sdX. */
+ (void) unit;
+ *name = 0;
#else
# warning "BIOS IDE drives cannot be guessed in your operating system."
/* Set NAME to a bogus string. */
/* QNX RTP doesn't distinguish SCSI from IDE, so it is better to
disable the detection of SCSI disks here. */
*name = 0;
+#elif defined(__CYGWIN__)
+ /* Cygwin emulates all disks as /dev/sdX. */
+ sprintf (name, "/dev/sd%c", unit + 'a');
#else
# warning "BIOS SCSI drives cannot be guessed in your operating system."
/* Set NAME to a bogus string. */
char buf[512];
FILE *fp;
- /* If DEVICE is empty, just return 1. */
+ /* If DEVICE is empty, just return error. */
if (*device == 0)
- return 1;
+ return 0;
fp = fopen (device, "r");
if (! fp)
}
}
}
-#endif /* __linux__ */
finish:
+#endif /* __linux__ */
+
if (fp != stdout)
fclose (fp);
}