* vfs.c (vfs_parse_filetype): Fix fallback to fifo if sockets

are not supported locally.  Support Solaris doors, also fall
back to fifo.
This commit is contained in:
Pavel Roskin 2001-10-07 09:01:17 +00:00
parent f30f16c588
commit 388a2fe2bf
2 changed files with 27 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2001-10-07 Pavel Roskin <proski@gnu.org>
* vfs.c (vfs_parse_filetype): Fix fallback to fifo if sockets
are not supported locally. Support Solaris doors, also fall
back to fifo.
2001-10-02 Andrew V. Samoilov <kai@cmail.ru>
* sfc.c (sfs_getid): Don't use vfs_die(), return (vfsid)(-1)

View File

@ -1472,19 +1472,28 @@ static int is_year(char *str, struct tm *tim)
int
vfs_parse_filetype (char c)
{
switch (c){
case 'd': return S_IFDIR;
case 'b': return S_IFBLK;
case 'c': return S_IFCHR;
case 'l': return S_IFLNK;
case 's':
#ifdef IS_IFSOCK /* And if not, we fall through to IFIFO, which is pretty close */
return S_IFSOCK;
switch (c) {
case 'd': return S_IFDIR;
case 'b': return S_IFBLK;
case 'c': return S_IFCHR;
case 'l': return S_IFLNK;
case 's': /* Socket */
#ifdef S_IFSOCK
return S_IFSOCK;
#else
/* If not supported, we fall through to IFIFO */
return S_IFIFO;
#endif
case 'p': return S_IFIFO;
case 'm': case 'n': /* Don't know what these are :-) */
case '-': case '?': return S_IFREG;
default: return -1;
case 'D': /* Solaris door */
#ifdef S_IFDOOR
return S_IFDOOR;
#else
return S_IFIFO;
#endif
case 'p': return S_IFIFO;
case 'm': case 'n': /* Don't know what these are :-) */
case '-': case '?': return S_IFREG;
default: return -1;
}
}