diff --git a/src/ChangeLog b/src/ChangeLog index fc6276d7e..231b5ff61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-09-23 Pavel Roskin + + * global.h: Move fcntl.h inclusion here. Define O_BINARY. + * mountlist.c: Remove more includes already handled in global.h. + 2002-09-22 Pavel Roskin * man2hlp.c (handle_alt_font): Implement .BR, .IR, .RB, .RI, .BI diff --git a/src/background.c b/src/background.c index 643276ed1..9a6760236 100644 --- a/src/background.c +++ b/src/background.c @@ -30,7 +30,6 @@ #endif #include #include -#include #include #include "global.h" diff --git a/src/cmd.c b/src/cmd.c index 5543e5dc9..5c5a905d4 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -28,7 +28,6 @@ #include #include #include -#include /* open, O_RDWR */ #include #ifdef USE_NETCODE diff --git a/src/cons.handler.c b/src/cons.handler.c index 51a0f16ca..61526296e 100644 --- a/src/cons.handler.c +++ b/src/cons.handler.c @@ -22,7 +22,6 @@ #ifdef HAVE_UNISTD_H # include #endif -#include #include #include diff --git a/src/ext.c b/src/ext.c index 024f4c9f8..4669fea94 100644 --- a/src/ext.c +++ b/src/ext.c @@ -25,7 +25,6 @@ #ifdef HAVE_UNISTD_H # include #endif -#include #include #include diff --git a/src/file.c b/src/file.c index ff6d35277..a6c1f650e 100644 --- a/src/file.c +++ b/src/file.c @@ -67,7 +67,6 @@ # include #endif /* HAVE_UNISTD_H */ #include -#include #include "global.h" #include "tty.h" diff --git a/src/filegui.c b/src/filegui.c index dfdfb24b5..4805dedba 100644 --- a/src/filegui.c +++ b/src/filegui.c @@ -70,7 +70,6 @@ # include #endif #include -#include #include "global.h" #include "tty.h" diff --git a/src/find.c b/src/find.c index 7338a6b34..fea7d515d 100644 --- a/src/find.c +++ b/src/find.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include "global.h" diff --git a/src/fsusage.c b/src/fsusage.c index acbf4844f..e90bdfe67 100644 --- a/src/fsusage.c +++ b/src/fsusage.c @@ -39,10 +39,6 @@ #include -#ifdef HAVE_FCNTL_H -#include -#endif - #ifdef HAVE_SYS_STATFS_H #include #endif diff --git a/src/global.h b/src/global.h index d30bef007..5c2e3e9f7 100644 --- a/src/global.h +++ b/src/global.h @@ -32,6 +32,24 @@ # include #endif +#ifdef HAVE_FCNTL_H +# include +#endif + +/* The O_BINARY definition was taken from gettext */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +#endif +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +#endif +/* On reasonable systems, binary I/O is the default. */ +#ifndef O_BINARY +# define O_BINARY 0 +#endif + #ifdef HAVE_SYS_TIMEB_H # include #endif diff --git a/src/main.c b/src/main.c index cbfed5f00..1e7c41818 100644 --- a/src/main.c +++ b/src/main.c @@ -39,7 +39,6 @@ #include #include -#include /* For O_RDWR */ #include /* Program include files */ diff --git a/src/mountlist.c b/src/mountlist.c index 3ad595309..9e4dc58f0 100644 --- a/src/mountlist.c +++ b/src/mountlist.c @@ -21,26 +21,6 @@ #include #include -#include - -#ifdef STDC_HEADERS -#include -#else -void free (void *ptr); -#endif -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) -#include -#else -#include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifdef HAVE_SYS_PARAM_H -#include -#endif #if defined (MOUNTED_GETFSSTAT) /* __alpha running OSF_1 */ #include diff --git a/src/mouse.c b/src/mouse.c index 4d2a3042c..ab787b412 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -25,7 +25,6 @@ #ifdef HAVE_UNISTD_H # include #endif -#include #include #include "global.h" diff --git a/src/popt.c b/src/popt.c index 8632fecf9..e7a472a17 100644 --- a/src/popt.c +++ b/src/popt.c @@ -9,7 +9,6 @@ #include "poptalloca.h" #include #include -#include #include #include #include diff --git a/src/subshell.c b/src/subshell.c index 38949ad70..bfab8aa71 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -36,7 +36,6 @@ #ifdef HAVE_SYS_IOCTL_H # include /* For ioctl() (surprise, surprise) */ #endif -#include /* For open(), etc. */ #include /* strstr(), strcpy(), etc. */ #include /* sigaction(), sigprocmask(), etc. */ #include /* Required by dir.h & panel.h below */ diff --git a/src/treestore.c b/src/treestore.c index d03131b3a..f3c55dd89 100644 --- a/src/treestore.c +++ b/src/treestore.c @@ -35,7 +35,6 @@ #ifdef HAVE_UNISTD_H #include #endif -#include #include #include #include diff --git a/src/user.c b/src/user.c index 82742f8ea..5e45cde13 100644 --- a/src/user.c +++ b/src/user.c @@ -20,7 +20,6 @@ #include #include #include -#include #include "global.h" #include "tty.h" diff --git a/src/util.c b/src/util.c index 81fc58dad..25121d264 100644 --- a/src/util.c +++ b/src/util.c @@ -27,7 +27,6 @@ #ifdef HAVE_UNISTD_H # include #endif -#include #include /* my_system */ #include /* INT_MAX */ #include diff --git a/src/utilunix.c b/src/utilunix.c index 14fc9ab7a..a819c006b 100644 --- a/src/utilunix.c +++ b/src/utilunix.c @@ -24,7 +24,6 @@ #ifdef HAVE_UNISTD_H # include #endif -#include #include /* my_system */ #include /* INT_MAX */ #include @@ -757,7 +756,6 @@ putenv (const char *string) #include #include /* defines queue_t */ #include /* defines struct strtdinsert */ -#include #define SPX_DEVICE "/dev/spx" #define S_PIPE_HANDLE_ERRNO 1 diff --git a/src/view.c b/src/view.c index 896b31c1e..d70bdab0c 100644 --- a/src/view.c +++ b/src/view.c @@ -36,7 +36,6 @@ #ifdef HAVE_MMAP # include #endif -#include #include /* For toupper() */ #include #include diff --git a/src/widget.c b/src/widget.c index 4e95e12c8..62720bf70 100644 --- a/src/widget.c +++ b/src/widget.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include "global.h" #include "tty.h"