summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2022-09-26 16:07:09 +0000
committermidipix <writeonce@midipix.org>2022-09-26 16:07:09 +0000
commitfcced56a2b9ae4305a15de0c640b5d01be4e58c2 (patch)
tree677871bc7c328ac285cfed9cd684927f990209d0 /src
parent1d23570efb00a30eea57ef2769d7fbb08a9bfb19 (diff)
downloadntux-fcced56a2b9ae4305a15de0c640b5d01be4e58c2.tar.bz2
ntux-fcced56a2b9ae4305a15de0c640b5d01be4e58c2.tar.xz
ntux_cmd_fspath(): use posix absolute notation as a fallback --syntax.
Diffstat (limited to 'src')
-rw-r--r--src/cmds/ntux_cmd_fspath.c14
1 files changed, 14 insertions, 0 deletions
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 */