]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: remove obsolete wholedisk.c
authorKarel Zak <kzak@redhat.com>
Tue, 17 Jun 2014 10:16:29 +0000 (12:16 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 17 Jun 2014 10:16:29 +0000 (12:16 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c
include/Makemodule.am
include/wholedisk.h [deleted file]
lib/Makemodule.am
lib/wholedisk.c [deleted file]

index 06ec15aee6681ff290c0688c8daa75ef04e7806f..5eb4e6a515c3c834b37322e4d071acf5576f93ed 100644 (file)
@@ -53,7 +53,6 @@
 #include "nls.h"
 #include "blkdev.h"
 #include "pathnames.h"
-#include "wholedisk.h"
 #include "all-io.h"
 #include "xalloc.h"
 #include "c.h"
index 08479fa0f29ea6dc5e3f9a35a96c497fb907ca43..993738d7ab4c0e8efb760a78701678f6efa1e618 100644 (file)
@@ -46,7 +46,6 @@ dist_noinst_HEADERS += \
        include/timer.h \
        include/timeutils.h \
        include/ttyutils.h \
-       include/wholedisk.h \
        include/widechar.h \
        include/xalloc.h \
        include/xgetpass.h \
diff --git a/include/wholedisk.h b/include/wholedisk.h
deleted file mode 100644 (file)
index 251479e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef WHOLEDISK_H
-#define WHOLEDISK_H
-
-extern int is_whole_disk(const char *name);
-extern int is_whole_disk_fd(int fd, const char *name);
-
-#endif /* WHOLEDISK_H */
-
index a16509670bf3cbe4e3d68af2d34d2df4f260493f..a31aef47112dc62fe4dc590c625b28ee490df22f 100644 (file)
@@ -22,7 +22,6 @@ libcommon_la_SOURCES = \
        lib/setproctitle.c \
        lib/strutils.c \
        lib/sysfs.c \
-       lib/wholedisk.c \
        lib/timeutils.c \
        lib/ttyutils.c \
        lib/xgetpass.c \
diff --git a/lib/wholedisk.c b/lib/wholedisk.c
deleted file mode 100644 (file)
index 5161a1e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * No copyright is claimed.  This code is in the public domain; do with
- * it what you wish.
- *
- * Written by Karel Zak <kzak@redhat.com>
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "blkdev.h"
-#include "wholedisk.h"
-
-int is_whole_disk_fd(int fd, const char *name)
-{
-#ifdef HDIO_GETGEO
-       if (fd != -1) {
-               struct hd_geometry geometry;
-               int i = ioctl(fd, HDIO_GETGEO, &geometry);
-               if (i == 0)
-                       return geometry.start == 0;
-       }
-#endif
-       /*
-        * The "silly heuristic" is still sexy for us, because
-        * for example Xen doesn't implement HDIO_GETGEO for virtual
-        * block devices (/dev/xvda).
-        *
-        * -- kzak@redhat.com (23-Feb-2006)
-        */
-       while (*name)
-               name++;
-       return !isdigit(name[-1]);
-}
-
-int is_whole_disk(const char *name)
-{
-       int fd = -1, res = 0;
-#ifdef HDIO_GETGEO
-       fd = open(name, O_RDONLY|O_CLOEXEC);
-       if (fd != -1)
-#endif
-               res = is_whole_disk_fd(fd, name);
-
-       if (fd != -1)
-               close(fd);
-       return res;
-}
-
-#ifdef TEST_PROGRAM
-int main(int argc, char **argv)
-{
-       if (argc < 2) {
-               fprintf(stderr, "usage: %s <device>\n", argv[0]);
-               exit(EXIT_FAILURE);
-       }
-
-       printf("%s: is%s whole disk\n", argv[1],
-                       is_whole_disk(argv[1]) ? "" : " NOT");
-       exit(EXIT_SUCCESS);
-}
-#endif