On 07/07/2009, Denys Vlasenko <[email protected]> wrote: > On Tue, Jul 7, 2009 at 3:05 PM, Luca Favatella<[email protected]> wrote: >> On 07/07/2009, walter harms <[email protected]> wrote: [...] > As I said, the patch is WRONG. platform.h may be included BEFORE > termios.h, and therefore it will see IUCLC not defined.
Sorry, I didn't think about this. > Version #2 is even worse: with attached .config it fails to build: Ok, I returned to version #1. Attached is version 3 of the patch. I included termios.h in platform.h before controlling if IUCLC is defined (similar to other places of platform.h). Thanks, Luca Favatella
From 25d01f338796d6bf00123d63c85a2071cc8e8961 Mon Sep 17 00:00:00 2001 From: Luca Favatella <[email protected]> Date: Tue, 7 Jul 2009 16:50:09 +0200 Subject: [PATCH] Move some IUCLC define into include/platform.h. Signed-off-by: Luca Favatella <[email protected]> --- coreutils/stty.c | 4 ---- include/platform.h | 6 ++++++ libbb/bb_askpass.c | 3 --- loginutils/getty.c | 4 ---- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/coreutils/stty.c b/coreutils/stty.c index 5506fdb..e02fe7c 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -68,10 +68,6 @@ # define CSWTCH _POSIX_VDISABLE #endif -#ifndef IUCLC -# define IUCLC 0 -#endif - /* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'. So the default is to disable 'swtch.' */ #if defined(__sparc__) && defined(__svr4__) diff --git a/include/platform.h b/include/platform.h index 99e747f..bc03d27 100644 --- a/include/platform.h +++ b/include/platform.h @@ -387,4 +387,10 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c) # define HAVE_NO_UTSNAME_DOMAINNAME #endif +#include <termios.h> +/* If this system doesn't have IUCLC bit in struct termios::c_iflag... */ +#ifndef IUCLC +# define IUCLC 0 +#endif + #endif diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index 073175c..c0dcf0c 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c @@ -37,9 +37,6 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) tcgetattr(fd, &oldtio); tcflush(fd, TCIFLUSH); tio = oldtio; -#ifndef IUCLC -# define IUCLC 0 -#endif tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY); tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP); tcsetattr_stdin_TCSANOW(&tio); diff --git a/loginutils/getty.c b/loginutils/getty.c index 838adf2..13273cd 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -22,10 +22,6 @@ #include <utmp.h> /* updwtmp() */ #endif -#ifndef IUCLC -# define IUCLC 0 -#endif - /* * Some heuristics to find out what environment we are in: if it is not * System V, assume it is SunOS 4. -- 1.6.3.3
_______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
