This patch defines IUCLC only in one place instead of "here and there".

It restores and uses some code committed in [gnu_kfreebsd] but
reverted in [freebsd].

Please consider this patch.


Cheers,
Luca Favatella



P.S.
In [freebsd] there are a lot of
-#include <features.h>
+//#include <features.h>
I don't know if they are normal or were committed as a mistake.



[gnu_kfreebsd] 
http://git.busybox.net/busybox/commit/?id=5a49d284a6a9f6cf2076f23561f95aebdfd44592
[freebsd] 
http://git.busybox.net/busybox/commit/?id=9b1b62adc4e4c1e80d9f72180c6b7b1eaef9f95a
From 30b7f324a3f7d118c2407ee7578990e02a42514f Mon Sep 17 00:00:00 2001
From: slackydeb <slacky...@doyle.(none)>
Date: Tue, 7 Jul 2009 11:01:38 +0200
Subject: [PATCH] Define IUCLC to 0 only in include/platform.h.


Signed-off-by: Luca Favatella <[email protected]>
---
 coreutils/stty.c   |    4 ----
 include/platform.h |    5 +++++
 libbb/bb_askpass.c |    3 ---
 loginutils/getty.c |    4 ----
 4 files changed, 5 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..882a66d 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -387,4 +387,9 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c)
 # define HAVE_NO_UTSNAME_DOMAINNAME
 #endif
 
+/* 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

Reply via email to