summaryrefslogtreecommitdiffstats
path: root/sys-utils/eject.c
diff options
context:
space:
mode:
authorKarel Zak2012-05-18 12:01:10 +0200
committerKarel Zak2012-05-18 12:01:10 +0200
commit28094b1e3c4b16d8a16dc78043b8887fdc99bd8a (patch)
tree7882b535f3693a23236ea1cf7ab4798e9501741e /sys-utils/eject.c
parentlibmount: don't canonicalize target (diff)
downloadkernel-qcow2-util-linux-28094b1e3c4b16d8a16dc78043b8887fdc99bd8a.tar.gz
kernel-qcow2-util-linux-28094b1e3c4b16d8a16dc78043b8887fdc99bd8a.tar.xz
kernel-qcow2-util-linux-28094b1e3c4b16d8a16dc78043b8887fdc99bd8a.zip
eject: allow to address device by LABEL/UUID
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/eject.c')
-rw-r--r--sys-utils/eject.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index e008886cf..4f3fb831f 100644
--- a/sys-utils/eject.c
+++ b/sys-utils/eject.c
@@ -944,9 +944,12 @@ int main(int argc, char **argv)
/* figure out full device or mount point name */
p = find_device(device);
- free(device);
+ if (p)
+ free(device);
+ else
+ p = device;
- device = mnt_resolve_path(p, NULL);
+ device = mnt_resolve_spec(p, NULL);
free(p);
}