From 388a2fe2bf1cdc0152016dc3276d14ddf31c2693 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 7 Oct 2001 09:01:17 +0000 Subject: [PATCH] * vfs.c (vfs_parse_filetype): Fix fallback to fifo if sockets are not supported locally. Support Solaris doors, also fall back to fifo. --- vfs/ChangeLog | 6 ++++++ vfs/vfs.c | 33 +++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 51ccad7aa..3f99dd26e 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,9 @@ +2001-10-07 Pavel Roskin + + * 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 * sfc.c (sfs_getid): Don't use vfs_die(), return (vfsid)(-1) diff --git a/vfs/vfs.c b/vfs/vfs.c index 64471826f..2c68aa339 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -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; } }