* util.c: Move replacements for permission bits ...
* fs.h: ... here. Add more replacements. * global.h: Include direct.h only with MSVC.
Этот коммит содержится в:
родитель
3d0de08b32
Коммит
e5c6976b15
@ -1,5 +1,9 @@
|
||||
2002-01-21 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* util.c: Move replacements for permission bits ...
|
||||
* fs.h: ... here. Add more replacements.
|
||||
* global.h: Include direct.h only with MSVC.
|
||||
|
||||
* main.c: Include "drive.h", not <drive.h>, do it after panel.h.
|
||||
Use _OS_NT as the condition for including drive.h.
|
||||
* screen.c: Use _OS_NT as the condition for including drive.h.
|
||||
|
46
src/fs.h
46
src/fs.h
@ -2,12 +2,56 @@
|
||||
|
||||
#ifndef __FS_H
|
||||
#define __FS_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
/* Replacement for permission bits missing in sys/stat.h */
|
||||
#ifndef S_IFLNK
|
||||
# define S_IFLNK 0
|
||||
#endif
|
||||
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(x) (((x) & S_IFLNK) == S_IFLNK)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFSOCK
|
||||
# define S_IFSOCK 0
|
||||
#endif
|
||||
|
||||
#ifndef S_ISSOCK
|
||||
# define S_ISSOCK(x) (((x) & S_IFSOCK) == S_IFSOCK)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFFIFO
|
||||
# define S_IFFIFO 0
|
||||
#endif
|
||||
|
||||
#ifndef S_ISFIFO
|
||||
# define S_ISFIFO(x) (((x) & S_IFFIFO) == S_IFFIFO)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFCHR
|
||||
# define S_IFCHR 0
|
||||
#endif
|
||||
|
||||
#ifndef S_ISCHR
|
||||
# define S_ISCHR(x) (((x) & S_IFCHR) == S_IFCHR)
|
||||
#endif
|
||||
|
||||
#ifndef S_IFBLK
|
||||
# define S_IFBLK 0
|
||||
#endif
|
||||
|
||||
#ifndef S_ISBLK
|
||||
# define S_ISBLK(x) (((x) & S_IFBLK) == S_IFBLK)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# define MC_MAXPATHLEN 4096
|
||||
#else
|
||||
@ -40,4 +84,4 @@
|
||||
# endif /* HAVE_NDIR_H */
|
||||
#endif /* not (HAVE_DIRENT_H or _POSIX_VERSION) */
|
||||
|
||||
#endif
|
||||
#endif /* !__FS_H */
|
||||
|
@ -11,7 +11,9 @@
|
||||
#ifdef _OS_NT
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
# include <direct.h>
|
||||
#ifdef _MSC_VER
|
||||
# include <direct.h> /* from mkdir() */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
|
13
src/util.h
13
src/util.h
@ -46,19 +46,6 @@ int get_int (char *, char *, int);
|
||||
char *load_file (char *filename);
|
||||
char *load_mc_home_file (const char *filename, char ** allocated_filename);
|
||||
|
||||
#include "fs.h"
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(x) (((x) & S_IFLNK) == S_IFLNK)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISSOCK
|
||||
# ifdef S_IFSOCK
|
||||
# define S_ISSOCK(x) (((x) & S_IFSOCK) == S_IFSOCK)
|
||||
# else
|
||||
# define S_ISSOCK(x) 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* uid/gid managing */
|
||||
void init_groups (void);
|
||||
void destroy_groups (void);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user