diff options
author | Karel Zak | 2009-06-30 01:13:42 +0200 |
---|---|---|
committer | Karel Zak | 2009-06-30 01:13:42 +0200 |
commit | c74c0daffffbecf1299055fb35908721bcc853b2 (patch) | |
tree | cdeb71fbc09387caadca13cda7860b18b3f4e49f /mount/lomount.c | |
parent | losetup: fix return codes of functions arounf is_associated() (diff) | |
download | kernel-qcow2-util-linux-c74c0daffffbecf1299055fb35908721bcc853b2.tar.gz kernel-qcow2-util-linux-c74c0daffffbecf1299055fb35908721bcc853b2.tar.xz kernel-qcow2-util-linux-c74c0daffffbecf1299055fb35908721bcc853b2.zip |
include: clean up _PATH_DEV_* macros
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r-- | mount/lomount.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index f0f81ed6d..c6e0c929c 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -60,8 +60,6 @@ loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info) return 0; } -#define DEV_LOOP_PATH "/dev/loop" -#define DEV_PATH "/dev" #define LOOPMAJOR 7 #define NLOOPS_DEFAULT 8 /* /dev/loop[0-7] */ @@ -143,10 +141,10 @@ looplist_open(struct looplist *ll, int flag) ll->flag = flag; ll->ncur = -1; - if (stat(DEV_PATH, &st) == -1 || (!S_ISDIR(st.st_mode))) + if (stat(_PATH_DEV, &st) == -1 || (!S_ISDIR(st.st_mode))) return -1; /* /dev doesn't exist */ - if (stat(DEV_LOOP_PATH, &st) == 0 && S_ISDIR(st.st_mode)) + if (stat(_PATH_DEV_LOOP, &st) == 0 && S_ISDIR(st.st_mode)) ll->flag |= LLFLG_SUBDIR; /* /dev/loop/ exists */ if ((ll->flag & LLFLG_USEDONLY) && @@ -179,8 +177,8 @@ looplist_open_dev(struct looplist *ll, int lnum) /* create a full device path */ snprintf(ll->name, sizeof(ll->name), ll->flag & LLFLG_SUBDIR ? - DEV_LOOP_PATH "/%d" : - DEV_PATH "/loop%d", + _PATH_DEV_LOOP "/%d" : + _PATH_DEV "/loop%d", lnum); fd = open(ll->name, O_RDONLY); @@ -331,8 +329,8 @@ looplist_next(struct looplist *ll) */ if (!ll->minors) { ll->nminors = (ll->flag & LLFLG_SUBDIR) ? - loop_scandir(DEV_LOOP_PATH, &ll->minors, 0) : - loop_scandir(DEV_PATH, &ll->minors, 1); + loop_scandir(_PATH_DEV_LOOP, &ll->minors, 0) : + loop_scandir(_PATH_DEV, &ll->minors, 1); ll->ncur = -1; } for (++ll->ncur; ll->ncur < ll->nminors; ll->ncur++) { |