diff options
author | Karel Zak | 2010-06-03 16:37:21 +0200 |
---|---|---|
committer | Karel Zak | 2010-06-03 16:37:21 +0200 |
commit | 54423a2569c564b10986e1d4eedfa8161f7cf721 (patch) | |
tree | 97442b8170e3bd36581110b3f6af4c630a9c23c3 /shlibs/mount/src/cache.c | |
parent | findmnt: move from /sbin to /bin (diff) | |
download | kernel-qcow2-util-linux-54423a2569c564b10986e1d4eedfa8161f7cf721.tar.gz kernel-qcow2-util-linux-54423a2569c564b10986e1d4eedfa8161f7cf721.tar.xz kernel-qcow2-util-linux-54423a2569c564b10986e1d4eedfa8161f7cf721.zip |
libmount: remove mnt_open_device()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/cache.c')
-rw-r--r-- | shlibs/mount/src/cache.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/shlibs/mount/src/cache.c b/shlibs/mount/src/cache.c index bd6ea3a02..027fda44f 100644 --- a/shlibs/mount/src/cache.c +++ b/shlibs/mount/src/cache.c @@ -239,7 +239,6 @@ const char *mnt_cache_find_tag(mnt_cache *cache, int mnt_cache_read_tags(mnt_cache *cache, const char *devname) { int i, ntags = 0; - int fd; static blkid_probe pr; const char *tags[] = { "LABEL", "UUID" }; @@ -264,14 +263,9 @@ int mnt_cache_read_tags(mnt_cache *cache, const char *devname) DBG(DEBUG_CACHE, printf("cache: reading tags for: %s\n", devname)); - fd = mnt_open_device(devname, O_RDONLY); - if (fd < 0) - return -1; - pr = blkid_new_probe(); + pr = blkid_new_probe_from_filename(devname); if (!pr) - goto error; - if (blkid_probe_set_device(pr, fd, 0, 0)) - goto error; + return -1; blkid_probe_enable_superblocks(pr, 1); @@ -304,7 +298,6 @@ int mnt_cache_read_tags(mnt_cache *cache, const char *devname) return ntags ? 0 : 1; error: blkid_free_probe(pr); - close(fd); return -1; } |