]> err.no Git - util-linux/commitdiff
fdisk: cleanup _PATH_DEV_* macros
authorKarel Zak <kzak@redhat.com>
Fri, 6 Feb 2009 21:23:13 +0000 (22:23 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 6 Feb 2009 21:23:13 +0000 (22:23 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisk/common.h
fdisk/partname.c
include/pathnames.h

index 380bbc39c45dbc6b598d6fdc61fe9abef2eba6f4..674e65f4a853c1ade4e11526e819f565f6517f69 100644 (file)
@@ -3,10 +3,6 @@
 
 /* common stuff for fdisk, cfdisk, sfdisk */
 
-/* udev paths */
-#define PATH_DEV_BYID   "/dev/disk/by-id"
-#define PATH_DEV_BYPATH "/dev/disk/by-path"
-
 struct systypes {
        unsigned char type;
        char *name;
index 2d629edfe09ac81171a6dc9a0ff186019ab49752..889e7f0b2940da84f8c307c6b9a5b8d025ecbcda 100644 (file)
@@ -5,6 +5,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include "blkdev.h"
+#include "pathnames.h"
 #include "common.h"
 
 /*
@@ -31,8 +32,8 @@ partname(char *dev, int pno, int lth) {
 
        /* udev names partitions by appending -partN
           e.g. ata-SAMSUNG_SV8004H_0357J1FT712448-part1 */
-       if ((strncmp(dev, PATH_DEV_BYID, strlen(PATH_DEV_BYID)) == 0) ||
-            strncmp(dev, PATH_DEV_BYPATH, strlen(PATH_DEV_BYPATH)) == 0) {
+       if ((strncmp(dev, _PATH_DEV_BYID, strlen(_PATH_DEV_BYID)) == 0) ||
+            strncmp(dev, _PATH_DEV_BYPATH, strlen(_PATH_DEV_BYPATH)) == 0) {
               p = "-part";
        }
 
index ad35bf91edec8cfb21327a89d7d2eaa9a487b544..0060a756f56c3d644575c6314f255737903424be 100644 (file)
@@ -97,6 +97,8 @@
 /* udev paths */
 #define _PATH_DEV_BYLABEL      "/dev/disk/by-label"
 #define _PATH_DEV_BYUUID       "/dev/disk/by-uuid"
+#define _PATH_DEV_BYID         "/dev/disk/by-id"
+#define _PATH_DEV_BYPATH       "/dev/disk/by-path"
 
 #endif /* PATHNAMES_H */