mirror of https://github.com/MidnightCommander/mc
* dir.c (file_type_to_num): Added initial support for the Special Named
Files. They are displayed as block devices, but with '#' prefix in it's names. Needed on QNX Neutrino. * file.c (copy_file_file): Likewise. * fs.h: Likewise. * screen.c (string_file_type): Likewise. (file_compute_color): Likewise. * util.c (string_perm): Likewise. * pipethrough.c: Added sys/select.h if found according to config.h.
This commit is contained in:
parent
3b8d52e2b9
commit
5ea26d084d
|
@ -1,3 +1,16 @@
|
|||
2004-11-04 Mike Gorchak <mike@malva.ua>
|
||||
|
||||
* dir.c (file_type_to_num): Added initial support for the Special Named
|
||||
Files. They are displayed as block devices, but with '#' prefix in it's
|
||||
names. Needed on QNX Neutrino.
|
||||
* file.c (copy_file_file): Likewise.
|
||||
* fs.h: Likewise.
|
||||
* screen.c (string_file_type): Likewise.
|
||||
(file_compute_color): Likewise.
|
||||
* util.c (string_perm): Likewise.
|
||||
|
||||
* pipethrough.c: Added sys/select.h if found according to config.h.
|
||||
|
||||
2004-11-04 Jindrich Novy <jnovy@redhat.com>
|
||||
|
||||
* screen.c (show_dir): A small fix to avoid a crash in show_dir() with
|
||||
|
|
|
@ -284,6 +284,8 @@ file_type_to_num (const file_entry *fe)
|
|||
return 6;
|
||||
if (S_ISFIFO (s->st_mode))
|
||||
return 7;
|
||||
if (S_ISNAM (s->st_mode)) /* Special named files will be shown as block devices */
|
||||
return 6;
|
||||
if (is_exe (s->st_mode))
|
||||
return 8;
|
||||
return 9;
|
||||
|
|
|
@ -547,6 +547,7 @@ copy_file_file (FileOpContext *ctx, const char *src_path, const char *dst_path,
|
|||
|
||||
if (S_ISCHR (sb.st_mode) || S_ISBLK (sb.st_mode)
|
||||
|| S_ISFIFO (sb.st_mode)
|
||||
|| S_ISNAM (sb.st_mode)
|
||||
|| S_ISSOCK (sb.st_mode)) {
|
||||
while (mc_mknod
|
||||
(dst_path, sb.st_mode & ctx->umask_kill,
|
||||
|
|
4
src/fs.h
4
src/fs.h
|
@ -36,6 +36,10 @@
|
|||
# define S_ISDOOR(x) 0
|
||||
#endif
|
||||
|
||||
/* Special named files are widely used in QNX6 */
|
||||
#ifndef S_ISNAM
|
||||
# define S_ISNAM(x) 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#include <string.h> /* On Solaris, FD_SET invokes memset(3) */
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#include <pipethrough.h>
|
||||
|
||||
|
|
|
@ -255,6 +255,8 @@ string_file_type (file_entry *fe, int len)
|
|||
buffer[0] = '+';
|
||||
else if (S_ISFIFO (fe->st.st_mode))
|
||||
buffer[0] = '|';
|
||||
else if (S_ISNAM (fe->st.st_mode))
|
||||
buffer[0] = '#';
|
||||
else if (!S_ISREG (fe->st.st_mode))
|
||||
buffer[0] = '?'; /* non-regular of unknown kind */
|
||||
else if (is_exe (fe->st.st_mode))
|
||||
|
@ -493,6 +495,8 @@ file_compute_color (int attr, file_entry *fe)
|
|||
return (DEVICE_COLOR);
|
||||
else if (S_ISBLK (fe->st.st_mode))
|
||||
return (DEVICE_COLOR);
|
||||
else if (S_ISNAM (fe->st.st_mode))
|
||||
return (DEVICE_COLOR);
|
||||
else if (S_ISFIFO (fe->st.st_mode))
|
||||
return (SPECIAL_COLOR);
|
||||
else if (S_ISDOOR (fe->st.st_mode))
|
||||
|
|
|
@ -377,6 +377,8 @@ string_perm (mode_t mode_bits)
|
|||
mode[0] = 'l';
|
||||
if (S_ISFIFO (mode_bits))
|
||||
mode[0] = 'p';
|
||||
if (S_ISNAM (mode_bits))
|
||||
mode[0] = 'n';
|
||||
if (S_ISSOCK (mode_bits))
|
||||
mode[0] = 's';
|
||||
if (S_ISDOOR (mode_bits))
|
||||
|
|
Loading…
Reference in New Issue