* fs.h: Correct S_IS* definitions to use S_IFMT. Add fallback
definitions for S_IFDOOR and S_ISDOOR. * screen.c (string_file_type): Remove unnesessary ifdefs, fs.h takes care of it. (file_compute_color): Add support for Solaris doors. * util.c (string_perm): Remove unnesessary ifdef.
Этот коммит содержится в:
родитель
d520b9f76f
Коммит
5e9c0314a2
@ -1,5 +1,12 @@
|
||||
2002-09-05 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* fs.h: Correct S_IS* definitions to use S_IFMT. Add fallback
|
||||
definitions for S_IFDOOR and S_ISDOOR.
|
||||
* screen.c (string_file_type): Remove unnesessary ifdefs, fs.h
|
||||
takes care of it.
|
||||
(file_compute_color): Add support for Solaris doors.
|
||||
* util.c (string_perm): Remove unnesessary ifdef.
|
||||
|
||||
* man2hlp.c (handle_command): Make clear that unsupported
|
||||
command is a warning, not an error. Avoid unsafe strcat().
|
||||
|
||||
|
20
src/fs.h
20
src/fs.h
@ -16,7 +16,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(x) (((x) & S_IFLNK) == S_IFLNK)
|
||||
# define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFSOCK
|
||||
@ -24,7 +24,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef S_ISSOCK
|
||||
# define S_ISSOCK(x) (((x) & S_IFSOCK) == S_IFSOCK)
|
||||
# define S_ISSOCK(x) (((x) & S_IFMT) == S_IFSOCK)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFFIFO
|
||||
@ -32,7 +32,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef S_ISFIFO
|
||||
# define S_ISFIFO(x) (((x) & S_IFFIFO) == S_IFFIFO)
|
||||
# define S_ISFIFO(x) (((x) & S_IFMT) == S_IFFIFO)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFCHR
|
||||
@ -40,7 +40,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef S_ISCHR
|
||||
# define S_ISCHR(x) (((x) & S_IFCHR) == S_IFCHR)
|
||||
# define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFBLK
|
||||
@ -48,9 +48,19 @@
|
||||
#endif
|
||||
|
||||
#ifndef S_ISBLK
|
||||
# define S_ISBLK(x) (((x) & S_IFBLK) == S_IFBLK)
|
||||
# define S_ISBLK(x) (((x) & S_IFMT) == S_IFBLK)
|
||||
#endif
|
||||
|
||||
/* Door is something that only exists on Solaris */
|
||||
#ifndef S_IFDOOR
|
||||
# define S_IFDOOR 0
|
||||
#endif
|
||||
|
||||
#ifndef S_ISDOOR
|
||||
# define S_ISDOOR(x) (((x) & S_IFMT) == S_IFDOOR)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# define MC_MAXPATHLEN 4096
|
||||
|
@ -229,14 +229,10 @@ string_file_type (file_entry *fe, int len)
|
||||
buffer [0] = '@';
|
||||
} else if (S_ISCHR (fe->buf.st_mode))
|
||||
buffer [0] = '-';
|
||||
#ifdef S_ISSOCK
|
||||
else if (S_ISSOCK (fe->buf.st_mode))
|
||||
buffer [0] = '=';
|
||||
#endif
|
||||
#ifdef S_ISDOOR
|
||||
else if (S_ISDOOR (fe->buf.st_mode))
|
||||
buffer [0] = '>';
|
||||
#endif
|
||||
else if (S_ISBLK (fe->buf.st_mode))
|
||||
buffer [0] = '+';
|
||||
else if (S_ISFIFO (fe->buf.st_mode))
|
||||
@ -476,6 +472,8 @@ file_compute_color (int attr, file_entry *fe)
|
||||
return (DEVICE_COLOR);
|
||||
else if (S_ISFIFO (fe->buf.st_mode))
|
||||
return (SPECIAL_COLOR);
|
||||
else if (S_ISDOOR (fe->buf.st_mode))
|
||||
return (SPECIAL_COLOR);
|
||||
else if (is_exe (fe->buf.st_mode))
|
||||
return (EXECUTABLE_COLOR);
|
||||
else if (fe->fname && (!strcmp (fe->fname, "core") || !strcmp (extension(fe->fname), "core")))
|
||||
|
@ -325,9 +325,7 @@ char *string_perm (mode_t mode_bits)
|
||||
|
||||
strcpy (mode, "----------");
|
||||
if (ismode (mode_bits, S_IFDIR)) mode [0] = 'd';
|
||||
#ifdef S_IFSOCK
|
||||
if (ismode (mode_bits, S_IFSOCK)) mode [0] = 's';
|
||||
#endif /* S_IFSOCK */
|
||||
if (ismode (mode_bits, S_IXOTH)) mode [9] = 'x';
|
||||
if (ismode (mode_bits, S_IWOTH)) mode [8] = 'w';
|
||||
if (ismode (mode_bits, S_IROTH)) mode [7] = 'r';
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user