summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/cmds/ntux_cmd_fspath.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/cmds/ntux_cmd_fspath.c b/src/cmds/ntux_cmd_fspath.c
index 9b25062..60d4192 100644
--- a/src/cmds/ntux_cmd_fspath.c
+++ b/src/cmds/ntux_cmd_fspath.c
@@ -60,27 +60,40 @@ int ntux_cmd_fspath(const struct ntux_driver_ctx * dctx, const char * dunit)
fdcwd,
(const char *)unit,
0,buf,bufsize)) < 0)
- return ntux_cmd_fspath_ret(buf,ret);
+ if (ntux_errno_set(dctx,ret))
+ return ntux_cmd_fspath_ret(
+ buf,
+ NTUX_SYSTEM_ERROR(dctx));
} else if (dctx->cctx->drvflags & NTUX_DRIVER_APATH) {
if ((ret = __sys_fs_apath(
fdcwd,
(const char *)unit,
0,buf,bufsize)) < 0)
- return ntux_cmd_fspath_ret(buf,ret);
+ if (ntux_errno_set(dctx,ret))
+ return ntux_cmd_fspath_ret(
+ buf,
+ NTUX_SYSTEM_ERROR(dctx));
+
} else if (dctx->cctx->drvflags & NTUX_DRIVER_NPATH) {
if ((ret = __sys_fs_npath(
fdcwd,
(const char *)unit,
0,buf,bufsize)) < 0)
- return ntux_cmd_fspath_ret(buf,ret);
+ if (ntux_errno_set(dctx,ret))
+ return ntux_cmd_fspath_ret(
+ buf,
+ NTUX_SYSTEM_ERROR(dctx));
} else if (dctx->cctx->drvflags & NTUX_DRIVER_DPATH) {
if ((ret = __sys_fs_dpath(
fdcwd,
(const char *)unit,
0,buf,bufsize)) < 0)
- return ntux_cmd_fspath_ret(buf,ret);
+ if (ntux_errno_set(dctx,ret))
+ return ntux_cmd_fspath_ret(
+ buf,
+ NTUX_SYSTEM_ERROR(dctx));
}
/* outupt */