From d18b300933cc1d0f87bc0f0537e3532ae6ca19d3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 21 May 2019 18:00:32 +0200 Subject: [PATCH] blockdev-util: propagate actual error --- src/basic/blockdev-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/blockdev-util.c b/src/basic/blockdev-util.c index 625bbdd943..5e7dc06c99 100644 --- a/src/basic/blockdev-util.c +++ b/src/basic/blockdev-util.c @@ -31,7 +31,7 @@ int block_get_whole_disk(dev_t d, dev_t *ret) { /* If it is a partition find the originating device */ xsprintf_sys_block_path(p, "/partition", d); if (access(p, F_OK) < 0) - return -ENOENT; + return -errno; /* Get parent dev_t */ xsprintf_sys_block_path(p, "/../dev", d); @@ -46,7 +46,7 @@ int block_get_whole_disk(dev_t d, dev_t *ret) { /* Only return this if it is really good enough for us. */ xsprintf_sys_block_path(p, "/queue", devt); if (access(p, F_OK) < 0) - return -ENOENT; + return -errno; *ret = devt; return 0; -- 2.25.1