From 1d23570efb00a30eea57ef2769d7fbb08a9bfb19 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 26 Sep 2022 15:58:20 +0000 Subject: ntux_cmd_fspath(): record errors in errv[] as needed. --- src/cmds/ntux_cmd_fspath.c | 21 +++++++++++++++++---- 1 file 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 */ -- cgit v1.2.3