From 7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de Mon Sep 17 00:00:00 2001 From: bigbiff Date: Thu, 1 Jan 2015 19:44:14 -0500 Subject: Update blkid to 2.25.0 Break libblkid into 4 libraries: libblkid, libuuid, libutil-linux and libfdisk. This should help in later patch updates. Change-Id: I680d9a7feb031e5c29a603e9c58aff4b65826262 --- libblkid/wholedisk.c | 62 ---------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 libblkid/wholedisk.c (limited to 'libblkid/wholedisk.c') diff --git a/libblkid/wholedisk.c b/libblkid/wholedisk.c deleted file mode 100644 index 1dbb90c5c..000000000 --- a/libblkid/wholedisk.c +++ /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 - */ -#include -#include -#include - -#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); - 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 \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 -- cgit v1.2.3