Mercurial > nomad
changeset 865:4105b14950bc
common: extend UNLINK to handle rmdir behavior as well
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sat, 17 Dec 2022 20:06:51 -0500 |
parents | eb2ea1fc3c03 |
children | eca18abb5295 |
files | docs/fs-protocol.md src/common/fscall.c src/common/rpc_fs.x |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/fs-protocol.md Wed Dec 14 23:21:47 2022 -0500 +++ b/docs/fs-protocol.md Sat Dec 17 20:06:51 2022 -0500 @@ -189,11 +189,15 @@ removed. If a null oid is specified and there are multiple dirents with the same name, the operation fails with `ENOTUNIQ`. +The rmdir bool specifies whether the operation is a rmdir (true) or unlink +(false). + Inputs ------ * directory open file handle * path component name * desired target oid +* rmdir semantics Outputs -------
--- a/src/common/fscall.c Wed Dec 14 23:21:47 2022 -0500 +++ b/src/common/fscall.c Sat Dec 17 20:06:51 2022 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> + * Copyright (c) 2016-2020,2022 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> * Copyright (c) 2016 Steve Dougherty * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -355,6 +355,7 @@ unlink_req.parent = parent_handle; unlink_req.name = (char *) name; + unlink_req.rmdir = false; if (desired) unlink_req.desired = *desired;
--- a/src/common/rpc_fs.x Wed Dec 14 23:21:47 2022 -0500 +++ b/src/common/rpc_fs.x Sat Dec 17 20:06:51 2022 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> + * Copyright (c) 2015-2020,2022 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> * Copyright (c) 2015 Holly Sipek * Copyright (c) 2015 Joshua Kahn <josh@joshuak.net> * Copyright (c) 2016 Steve Dougherty @@ -105,6 +105,7 @@ HANDLE(parent); string name<>; struct noid desired; + bool rmdir; }; %/***** OPEN *****/