From 27387673a4e6d3173fdcf4badd27cbf05dfc5290 Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 4 May 2012 22:34:51 +0000 Subject: [PATCH] =?UTF-8?q?new=20MKSH=5FDISABLE=5FTTY=5FWARNING=20for=20po?= =?UTF-8?q?rts=20that=20just=20can=E2=80=99t=20help=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TODO: add_cppflags this automatically in the TARGET_OS switch for some --- Build.sh | 5 +++-- jobs.c | 4 +++- main.c | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Build.sh b/Build.sh index ba6240f..5851586 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.562 2012/05/04 22:18:22 tg Exp $' +srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.563 2012/05/04 22:34:49 tg Exp $' #- # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 @@ -1410,7 +1410,7 @@ else #define EXTERN #define MKSH_INCLUDES_ONLY #include "sh.h" - __RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.562 2012/05/04 22:18:22 tg Exp $"); + __RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.563 2012/05/04 22:34:49 tg Exp $"); int main(void) { printf("Hello, World!\n"); return (0); } EOF case $cm in @@ -2108,6 +2108,7 @@ MKSH_CONSERVATIVE_FDS fd 0-9 for scripts, shell only up to 31 MKSH_DEFAULT_EXECSHELL "/bin/sh" (do not change) MKSH_DEFAULT_TMPDIR "/tmp" (do not change) MKSH_DISABLE_DEPRECATED disable code paths scheduled for later removal +MKSH_DISABLE_TTY_WARNING shut up warning about ctty if OS cant be fixed MKSH_DONT_EMIT_IDSTRING omit RCS IDs from binary MKSH_MIDNIGHTBSD01ASH_COMPAT set -o sh: additional compatibility quirk MKSH_NOPROSPECTOFWORK disable jobs, co-processes, etc. (do not use) diff --git a/jobs.c b/jobs.c index 9d29984..4879c87 100644 --- a/jobs.c +++ b/jobs.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.87 2012/05/04 22:18:25 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.88 2012/05/04 22:34:50 tg Exp $"); #if HAVE_KILLPG #define mksh_killpg killpg @@ -329,9 +329,11 @@ j_change(void) kshpgrp = kshpid; } } +#ifndef MKSH_DISABLE_TTY_WARNING if (use_tty && !ttypgrp_ok) warningf(false, "%s: %s", "warning", "won't have full job control"); +#endif if (tty_fd >= 0) mksh_tcget(tty_fd, &tty_state); } else { diff --git a/main.c b/main.c index 50ab100..fff7aa3 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/main.c,v 1.220 2012/05/04 22:18:26 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/main.c,v 1.221 2012/05/04 22:34:51 tg Exp $"); extern char **environ; @@ -1048,10 +1048,12 @@ tty_init(bool init_ttystate, bool need_tty) #endif if ((tfd = open("/dev/tty", O_RDWR, 0)) < 0) { tty_devtty = false; +#ifndef MKSH_DISABLE_TTY_WARNING if (need_tty) warningf(false, "%s: %s %s: %s", "No controlling tty", "open", "/dev/tty", strerror(errno)); +#endif } if (tfd < 0) { do_close = false; @@ -1060,8 +1062,10 @@ tty_init(bool init_ttystate, bool need_tty) else if (isatty(2)) tfd = 2; else { +#ifndef MKSH_DISABLE_TTY_WARNING if (need_tty) warningf(false, "can't find tty fd"); +#endif return; } }