mdev: fix breakage caused by unified parser usage
[oweals/busybox.git] / util-linux / volume_id / volume_id.c
index de9aae2cea98cd2b987bba0ce116ccd0ed65c20f..6852a8203d9f2393ff8e698395b2e0959b0b0f1a 100644 (file)
@@ -152,7 +152,7 @@ static const probe_fptr fs2[] = {
 
 int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size)
 {
-       int i;
+       unsigned i;
 
        if (id == NULL)
                return -EINVAL;
@@ -190,19 +190,14 @@ int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size)
 }
 
 /* open volume by device node */
-struct volume_id *volume_id_open_node(const char *path)
+struct volume_id *volume_id_open_node(int fd)
 {
        struct volume_id *id;
-       int fd;
 
-       fd = open(path, O_RDONLY);
-       if (fd < 0)
-               return NULL;
        id = xzalloc(sizeof(struct volume_id));
        id->fd = fd;
        ///* close fd on device close */
        //id->fd_close = 1;
-
        return id;
 }