From 395c04fbca7760979b7bc4e371c1f9f8e1d09858 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Fri, 7 Feb 2014 06:55:31 -0800 Subject: [PATCH] fs: display cell not available on ESRCH The cache manager pioctls abuse ESRCH to represent errors due to unavailable cell information. Give a more sensible error message to the user when a pioctl returns an ESRCH error, instead of "no such process", which is the conventional meaning of ESRCH. The new error message is consistent with the Windows implementation of fs. For example, on a host with a misconfigured ThisCell and/or CellServDB. $ fs wscell fs: No such process becomes: $ fs wscell fs: Cell name not recognized. Reviewed-on: http://gerrit.openafs.org/10824 Tested-by: BuildBot Reviewed-by: D Brashear (cherry picked from commit 8beba712d95b637225f215534a759961ff4d80a9) Change-Id: I0cf6f6e0939a1075332049361153bc8a0b0958ce Reviewed-on: http://gerrit.openafs.org/10949 Reviewed-by: D Brashear Reviewed-by: Andrew Deason Tested-by: Andrew Deason Reviewed-by: Jeffrey Altman Reviewed-by: Stephan Wiesand --- src/venus/fs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/venus/fs.c b/src/venus/fs.c index fd797b3e6..ba4776d80 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -3960,6 +3960,9 @@ Die(int errnum, char *filename) "%s: You do not have the required rights to do this operation\n", pn); break; + case ESRCH: /* hack: pioctls stole ESRCH for cell name not available errors. */ + fprintf(stderr, "%s: Cell name not recognized.\n", pn); + break; default: if (filename) fprintf(stderr, "%s:'%s'", pn, filename); -- 2.39.5