diff options
author | midipix <writeonce@midipix.org> | 2022-09-26 15:58:20 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2022-09-26 15:58:20 +0000 |
commit | 1d23570efb00a30eea57ef2769d7fbb08a9bfb19 (patch) | |
tree | c5ff020a25ed251fce1e1761e2ca1a556edca544 | |
parent | 8ec5cef55b0a328992210b42f1186a1402b21169 (diff) | |
download | ntux-1d23570efb00a30eea57ef2769d7fbb08a9bfb19.tar.bz2 ntux-1d23570efb00a30eea57ef2769d7fbb08a9bfb19.tar.xz |
ntux_cmd_fspath(): record errors in errv[] as needed.
-rw-r--r-- | src/cmds/ntux_cmd_fspath.c | 21 |
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 */ |