diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-11 13:57:20 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-11 13:57:20 +0200 |
commit | d569bb029983cff947dce704e6f830276204c13f (patch) | |
tree | 50736305a13af688a8321d0b4688042f61526362 /src/fileio.c | |
parent | 90f1e2b7bcf56112e1535b693acf131727179a6e (diff) | |
download | vim-git-d569bb029983cff947dce704e6f830276204c13f.tar.gz |
patch 8.1.0268: file type checking has too many #ifdefv8.1.0268
Problem: File type checking has too many #ifdef.
Solution: Always define the S_IF macros. (Ken Takata, closes #3306)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/fileio.c b/src/fileio.c index 42f388a11..7bceb75fd 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -424,12 +424,8 @@ readfile( */ perm = mch_getperm(fname); if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */ -# ifdef S_ISFIFO && !S_ISFIFO(perm) /* ... or fifo */ -# endif -# ifdef S_ISSOCK && !S_ISSOCK(perm) /* ... or socket */ -# endif # ifdef OPEN_CHR_FILES && !(S_ISCHR(perm) && is_dev_fd_file(fname)) /* ... or a character special file named /dev/fd/<n> */ @@ -2497,28 +2493,16 @@ failed: c = FALSE; #ifdef UNIX -# ifdef S_ISFIFO - if (S_ISFIFO(perm)) /* fifo or socket */ - { - STRCAT(IObuff, _("[fifo/socket]")); - c = TRUE; - } -# else -# ifdef S_IFIFO - if ((perm & S_IFMT) == S_IFIFO) /* fifo */ + if (S_ISFIFO(perm)) /* fifo */ { STRCAT(IObuff, _("[fifo]")); c = TRUE; } -# endif -# ifdef S_IFSOCK - if ((perm & S_IFMT) == S_IFSOCK) /* or socket */ + if (S_ISSOCK(perm)) /* or socket */ { STRCAT(IObuff, _("[socket]")); c = TRUE; } -# endif -# endif # ifdef OPEN_CHR_FILES if (S_ISCHR(perm)) /* or character special */ { |