On 07/07/2009, walter harms <[email protected]> wrote:
[...]
> Luca Favatella schrieb:
>> This patch defines IUCLC only in one place instead of "here and there".
[...]
> but we should give unsuspecting users a warning, should'nt we ?
> like:
>
> #warn ingnoring IUCLC flag in termio
> # define IUCLC 0

Fixed in the attached second version of the patch.
I also fixed my email address in the patch.


> re,
>  wh

Thanks,
Luca Favatella
From 20339a3c4163110bc8f9c18fc9e28330c367ebf3 Mon Sep 17 00:00:00 2001
From: Luca Favatella <[email protected]>
Date: Tue, 7 Jul 2009 14:59:29 +0200
Subject: [PATCH] Define IUCLC to 0 only in include/platform.h, giving a warning.


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..7c36c0c 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
 
+/* If this system doesn't have IUCLC bit in struct termios::c_iflag... */
+#ifndef IUCLC
+# warning "ignoring IUCLC bit in struct termios::c_iflag"
+# 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