From: Karel Zak Date: Fri, 6 Feb 2009 21:23:13 +0000 (+0100) Subject: fdisk: cleanup _PATH_DEV_* macros X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=525dd3163586a47f2c91abb749d436b5cf4f7dd9;p=util-linux fdisk: cleanup _PATH_DEV_* macros Signed-off-by: Karel Zak --- diff --git a/fdisk/common.h b/fdisk/common.h index 380bbc39..674e65f4 100644 --- a/fdisk/common.h +++ b/fdisk/common.h @@ -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; diff --git a/fdisk/partname.c b/fdisk/partname.c index 2d629edf..889e7f0b 100644 --- a/fdisk/partname.c +++ b/fdisk/partname.c @@ -5,6 +5,7 @@ #include #include #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"; } diff --git a/include/pathnames.h b/include/pathnames.h index ad35bf91..0060a756 100644 --- a/include/pathnames.h +++ b/include/pathnames.h @@ -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 */