diff options
Diffstat (limited to 'util-linux/fdisk.c')
-rw-r--r-- | util-linux/fdisk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 39eb27b47..7fe70fb72 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -2781,14 +2781,14 @@ is_ide_cdrom_or_tape(const char *device) | |||
2781 | the process hangs on the attempt to read a music CD. | 2781 | the process hangs on the attempt to read a music CD. |
2782 | So try to be careful. This only works since 2.1.73. */ | 2782 | So try to be careful. This only works since 2.1.73. */ |
2783 | 2783 | ||
2784 | if (strncmp("/dev/hd", device, 7)) | 2784 | if (!is_prefixed_with(device, "/dev/hd")) |
2785 | return 0; | 2785 | return 0; |
2786 | 2786 | ||
2787 | snprintf(buf, sizeof(buf), "/proc/ide/%s/media", device+5); | 2787 | snprintf(buf, sizeof(buf), "/proc/ide/%s/media", device+5); |
2788 | procf = fopen_for_read(buf); | 2788 | procf = fopen_for_read(buf); |
2789 | if (procf != NULL && fgets(buf, sizeof(buf), procf)) | 2789 | if (procf != NULL && fgets(buf, sizeof(buf), procf)) |
2790 | is_ide = (!strncmp(buf, "cdrom", 5) || | 2790 | is_ide = (is_prefixed_with(buf, "cdrom") || |
2791 | !strncmp(buf, "tape", 4)); | 2791 | is_prefixed_with(buf, "tape")); |
2792 | else | 2792 | else |
2793 | /* Now when this proc file does not exist, skip the | 2793 | /* Now when this proc file does not exist, skip the |
2794 | device when it is read-only. */ | 2794 | device when it is read-only. */ |