diff options
author | Sami Kerola | 2013-04-02 21:42:50 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-05 13:56:03 +0200 |
commit | 114ade3d1be7c9091999d49ba97130641c4dde86 (patch) | |
tree | 3c6998ec111237a1a309dacb3a6934a6e2b148a5 /sys-utils | |
parent | fsfreeze: tell user when mandatory option is not specified (diff) | |
download | kernel-qcow2-util-linux-114ade3d1be7c9091999d49ba97130641c4dde86.tar.gz kernel-qcow2-util-linux-114ade3d1be7c9091999d49ba97130641c4dde86.tar.xz kernel-qcow2-util-linux-114ade3d1be7c9091999d49ba97130641c4dde86.zip |
losetup: allow -j option argument to be relative path
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils')
-rw-r--r-- | sys-utils/losetup.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 45e46c8c1..8f3614e1f 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -23,6 +23,7 @@ #include "closestream.h" #include "optutils.h" #include "xalloc.h" +#include "canonicalize.h" enum { A_CREATE = 1, /* setup a new device */ @@ -167,9 +168,15 @@ static int show_all_loops(struct loopdev_cxt *lc, const char *file, st = NULL; while (loopcxt_next(lc) == 0) { - - if (file && !loopcxt_is_used(lc, st, file, offset, flags)) - continue; + if (file && !loopcxt_is_used(lc, st, file, offset, flags)) { + char *canonized; + int ret; + canonized = canonicalize_path(file); + ret = loopcxt_is_used(lc, st, canonized, offset, flags); + free(canonized); + if (!ret) + continue; + } printf_loopdev(lc); } loopcxt_deinit_iterator(lc); |