From fcced56a2b9ae4305a15de0c640b5d01be4e58c2 Mon Sep 17 00:00:00 2001 From: midipix Date: Sep 26 2022 16:07:09 +0000 Subject: ntux_cmd_fspath(): use posix absolute notation as a fallback --syntax. --- diff --git a/src/cmds/ntux_cmd_fspath.c b/src/cmds/ntux_cmd_fspath.c index 60d4192..12d575c 100644 --- a/src/cmds/ntux_cmd_fspath.c +++ b/src/cmds/ntux_cmd_fspath.c @@ -65,6 +65,7 @@ int ntux_cmd_fspath(const struct ntux_driver_ctx * dctx, const char * dunit) buf, NTUX_SYSTEM_ERROR(dctx)); + /* posix absolute notation? */ } else if (dctx->cctx->drvflags & NTUX_DRIVER_APATH) { if ((ret = __sys_fs_apath( fdcwd, @@ -75,6 +76,7 @@ int ntux_cmd_fspath(const struct ntux_driver_ctx * dctx, const char * dunit) buf, NTUX_SYSTEM_ERROR(dctx)); + /* native tool notation? */ } else if (dctx->cctx->drvflags & NTUX_DRIVER_NPATH) { if ((ret = __sys_fs_npath( fdcwd, @@ -85,6 +87,7 @@ int ntux_cmd_fspath(const struct ntux_driver_ctx * dctx, const char * dunit) buf, NTUX_SYSTEM_ERROR(dctx)); + /* native driver notation? */ } else if (dctx->cctx->drvflags & NTUX_DRIVER_DPATH) { if ((ret = __sys_fs_dpath( fdcwd, @@ -94,6 +97,17 @@ int ntux_cmd_fspath(const struct ntux_driver_ctx * dctx, const char * dunit) return ntux_cmd_fspath_ret( buf, NTUX_SYSTEM_ERROR(dctx)); + + /* [default] posix absolute notation */ + } else { + if ((ret = __sys_fs_apath( + fdcwd, + (const char *)unit, + 0,buf,bufsize)) < 0) + if (ntux_errno_set(dctx,ret)) + return ntux_cmd_fspath_ret( + buf, + NTUX_SYSTEM_ERROR(dctx)); } /* outupt */