]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: remove unused guess_device_type() function
authorFrancesco Cosoleto <cosoleto@gmail.com>
Thu, 15 Dec 2011 19:02:44 +0000 (20:02 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 16 Dec 2011 13:04:05 +0000 (14:04 +0100)
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
fdisk/fdisk.c
fdisk/fdisksunlabel.c
fdisk/fdisksunlabel.h

index aacd73f590e20c9483b5fe08c9ddadcaa6188e37..8f5869dcfe30fec594fa3ea4df45a846dc11aa62 100644 (file)
@@ -1031,7 +1031,6 @@ get_geometry(int fd, struct geom *g) {
        unsigned long long llcyls, nsects = 0;
 
        get_topology(fd);
-       guess_device_type(fd);
        heads = cylinders = sectors = 0;
        kern_heads = kern_sectors = 0;
        pt_heads = pt_sectors = 0;
index 4fd8545c3002c93a6c94525728c1ecbc046624bd..4a6db35f3b26fe88daff02ef9c95f7d1a296edf7 100644 (file)
 #include <string.h>            /* strstr */
 #include <unistd.h>            /* write */
 #include <sys/ioctl.h>         /* ioctl */
-#include <sys/stat.h>          /* stat */
-#include <sys/sysmacros.h>     /* major */
 
 #include "nls.h"
 #include "blkdev.h"
 
 #include <endian.h>
-#ifdef HAVE_LINUX_MAJOR_H
-#include <linux/major.h>       /* FLOPPY_MAJOR */
-#endif
 
 #include "common.h"
 #include "fdisk.h"
 #include "fdisksunlabel.h"
 
 static int     other_endian = 0;
-static int     scsi_disk = 0;
-static int     floppy = 0;
 
 struct systypes sun_sys_types[] = {
        {SUN_TAG_UNASSIGNED, N_("Unassigned")},
@@ -66,37 +59,6 @@ static inline uint32_t __swap32(uint32_t x) {
 #define SSWAP32(x) (other_endian ? __swap32(x) \
                                 : (uint32_t)(x))
 
-#ifndef FLOPPY_MAJOR
-#define FLOPPY_MAJOR 2
-#endif
-#ifndef IDE0_MAJOR
-#define IDE0_MAJOR 3
-#endif
-#ifndef IDE1_MAJOR
-#define IDE1_MAJOR 22
-#endif
-void guess_device_type(int fd)
-{
-       struct stat bootstat;
-
-       if (fstat (fd, &bootstat) < 0) {
-                scsi_disk = 0;
-                floppy = 0;
-       } else if (S_ISBLK(bootstat.st_mode)
-                  && (major(bootstat.st_rdev) == IDE0_MAJOR ||
-                      major(bootstat.st_rdev) == IDE1_MAJOR)) {
-                scsi_disk = 0;
-                floppy = 0;
-       } else if (S_ISBLK(bootstat.st_mode)
-                  && major(bootstat.st_rdev) == FLOPPY_MAJOR) {
-                scsi_disk = 0;
-                floppy = 1;
-       } else {
-                scsi_disk = 1;
-                floppy = 0;
-       }
-}
-
 static void set_sun_partition(int i, uint32_t start, uint32_t stop, uint16_t sysid)
 {
        sunlabel->part_tags[i].tag = SSWAP16(sysid);
index b7419cb178e7b32b78842a21a790ec71e17b9cf1..fa3f964d90fcbe6fe74818eb63cabe4f423c0693 100644 (file)
@@ -77,7 +77,6 @@ struct sun_disk_label {
 
 /* fdisksunlabel.c */
 extern struct systypes sun_sys_types[];
-extern void guess_device_type(int fd);
 extern int check_sun_label(void);
 extern void sun_nolabel(void);
 extern void create_sunlabel(void);