mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
blockdev-util: propagate actual error
This commit is contained in:
parent
007b77ac6c
commit
d18b300933
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user