diff options
author | Clint Adams <clint@users.sourceforge.net> | 2000-08-02 14:20:41 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2000-08-02 14:20:41 +0000 |
commit | de7b6730bcebf08368e7531b68c6a2598166eb86 (patch) | |
tree | 84346c80d789be066ed3bc6e42bee6244e9b322c /Src/Modules/parameter.c | |
parent | 30e35ee2ed1cf4a574fc9017229c43fc84105b5b (diff) | |
download | zsh-de7b6730bcebf08368e7531b68c6a2598166eb86.tar.gz zsh-de7b6730bcebf08368e7531b68c6a2598166eb86.tar.xz zsh-de7b6730bcebf08368e7531b68c6a2598166eb86.zip |
12489: pathconf for unlimited fs
Diffstat (limited to 'Src/Modules/parameter.c')
-rw-r--r-- | Src/Modules/parameter.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c index b19202625..7267025a9 100644 --- a/Src/Modules/parameter.c +++ b/Src/Modules/parameter.c @@ -1400,11 +1400,13 @@ setpmnameddir(Param pm, char *value) #ifdef HAVE_PATHCONF int pathmax = 0; + errno = 0; pathmax = pathconf(value, _PC_PATH_MAX); - if (pathmax == -1) { + if ((pathmax == -1) && errno) { zwarn("%s: %e", value, errno); } - else if (!value || *value != '/' || strlen(value) >= pathmax) + else if (!value || *value != '/' || ((strlen(value) >= pathmax) && + pathmax != -1)) #else if (!value || *value != '/' || strlen(value) >= PATH_MAX) #endif @@ -1456,7 +1458,8 @@ setpmnameddirs(Param pm, HashTable ht) v.pm = (Param) hn; #ifdef HAVE_PATHCONF - if((pathmax = pathconf(val, _PC_PATH_MAX)) == -1) + errno = 0; + if((((pathmax = pathconf(val, _PC_PATH_MAX)) == -1)) && errno) zwarn("%s: %e", val, errno); else #endif @@ -1464,7 +1467,7 @@ setpmnameddirs(Param pm, HashTable ht) #ifdef HAVE_PATHCONF strlen(val) >= PATH_MAX) #else - strlen(val) >= pathmax) + ((strlen(val) >= pathmax)) && pathmax != -1) #endif zwarn("invalid value: %s", val, 0); else |