[Patch] cld: return more correct codes
When doing "ls /foo" in cldcli currently, server reports "invalid inode
number". But in fact it's a name that's incorrect, all numbers are fine.
It seems we need to return "invalid name" afer we looked up by name,
and "invalid number" after we looked up by number (this is ok now and
not changed by the patch).
Signed-off-by: Pete Zaitcev <zaitcev@xxxxxxxxxx>
diff --git a/server/msg.c b/server/msg.c
index 6666d3c..4ac806e 100644
--- a/server/msg.c
+++ b/server/msg.c
@@ -583,7 +583,7 @@ void msg_open(struct msg_params *mp)
goto err_out;
}
if (!create && (rc == DB_NOTFOUND)) {
- resp_rc = CLE_INODE_INVAL;
+ resp_rc = CLE_NAME_INVAL;
goto err_out;
}
if (create && rc == 0) {
@@ -990,7 +990,7 @@ void msg_del(struct msg_params *mp)
rc = cldb_inode_get_byname(txn, name, name_len, &ino, false, 0);
if (rc) {
if (rc == DB_NOTFOUND)
- resp_rc = CLE_INODE_INVAL;
+ resp_rc = CLE_NAME_INVAL;
else
resp_rc = CLE_DB_ERR;
goto err_out;
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]