aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-12-16 06:02:53 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-12-16 06:02:53 +0200
commit9ba56d858e953d2c2e83ba04cfcceb55899dbedd (patch)
treea81b409787cc2a66b46bf9a58dba2506da3658ac
parente15a309fd9c8b26b959a15a84620f0c7c0201545 (diff)
parentedbc856be17c8d0a1b3ae8d7a2e6007f44bbb192 (diff)
downloadegawk-9ba56d858e953d2c2e83ba04cfcceb55899dbedd.tar.gz
egawk-9ba56d858e953d2c2e83ba04cfcceb55899dbedd.tar.bz2
egawk-9ba56d858e953d2c2e83ba04cfcceb55899dbedd.zip
Merge branch 'gawk-4.1-stable'
-rw-r--r--ChangeLog10
-rw-r--r--NEWS2
-rw-r--r--extension/ChangeLog8
-rw-r--r--extension/configh.in5
-rwxr-xr-xextension/configure1
-rw-r--r--extension/configure.ac1
-rw-r--r--extension/ext_custom.h37
-rw-r--r--io.c86
-rw-r--r--profile.c3
9 files changed, 112 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 62af049e..7f11b673 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-12-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pp_number): Move count into ifdef for MPFR. Avoids
+ an unused variable warning if not compiling for MPFR.
+
+ Unrelated:
+
+ * io.c (two_way_open): If using a pty instead of pipes, open the
+ slave in the child. Fixes AIX and doesn't seem to break GNU/Linux.
+
2015-11-26 Arnold D. Robbins <arnold@skeeve.com>
* command.y (cmdtab): Add "exit" as synonym for "quit".
diff --git a/NEWS b/NEWS
index 2475bdc2..6a37d979 100644
--- a/NEWS
+++ b/NEWS
@@ -81,6 +81,8 @@ Changes from 4.1.3 to 4.1.x
4. The "exit" command has been added to the debugger as an alias
for "quit".
+5. AIX 7.1 should pass the test suite now.
+
Changes from 4.1.2 to 4.1.3
---------------------------
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 59deaba4..65a419df 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,11 @@
+2015-12-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make change of 2015-10-26 actually work.
+
+ * ext_custom.h: New file. Move _DEFAULT_SOURCE dance to here.
+ * configure.ac: Add call to AH_BOTTOM.
+ * configure: Regenerate.
+
2015-11-15 Ville Skytta <ville.skytta@iki.fi>
* fnmatch.3am, fork.3am, inplace.3am, ordchr.3am, readdir.3am,
diff --git a/extension/configh.in b/extension/configh.in
index a52f609d..82cbb8f5 100644
--- a/extension/configh.in
+++ b/extension/configh.in
@@ -147,9 +147,6 @@
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
-#if defined _GNU_SOURCE && !defined _DEFAULT_SOURCE
-# define _DEFAULT_SOURCE
-#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
@@ -193,3 +190,5 @@
#ifndef __cplusplus
#undef inline
#endif
+
+#include "ext_custom.h"
diff --git a/extension/configure b/extension/configure
index 0e6dd611..e42ceb60 100755
--- a/extension/configure
+++ b/extension/configure
@@ -13035,6 +13035,7 @@ esac
ac_config_headers="$ac_config_headers config.h:configh.in"
+
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
diff --git a/extension/configure.ac b/extension/configure.ac
index 5ff4ab69..dfab0b8d 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -79,6 +79,7 @@ dnl checks for compiler characteristics
AC_C_INLINE
AC_CONFIG_HEADERS([config.h:configh.in])
+AH_BOTTOM([#include "ext_custom.h"])
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
diff --git a/extension/ext_custom.h b/extension/ext_custom.h
new file mode 100644
index 00000000..13702f24
--- /dev/null
+++ b/extension/ext_custom.h
@@ -0,0 +1,37 @@
+/*
+ * ext_custom.h
+ *
+ * This file is for use on systems where Autoconf isn't quite able to
+ * get things right. It is appended to the bottom of config.h by configure,
+ * in order to override definitions from Autoconf that are erroneous. See
+ * the manual for more information.
+ *
+ * If you make additions to this file for your system, please send me
+ * the information, to arnold@skeeve.com.
+ */
+
+/*
+ * Copyright (C) 2015 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* From Michal Jaegermann for bleeding edge GLIBC. */
+#if defined _GNU_SOURCE && !defined _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#endif
diff --git a/io.c b/io.c
index 62c93c88..fe234efb 100644
--- a/io.c
+++ b/io.c
@@ -1965,56 +1965,75 @@ two_way_open(const char *str, struct redirect *rp, int extfd)
goto use_pipes;
got_the_pty:
- if ((slave = open(slavenam, O_RDWR)) < 0) {
- close(master);
- fatal(_("could not open `%s', mode `%s'"),
- slavenam, "r+");
- }
-#ifdef I_PUSH
/*
- * Push the necessary modules onto the slave to
- * get terminal semantics.
+ * We specifically open the slave only in the child. This allows
+ * certain, er, "limited" systems to work. The open is specifically
+ * without O_NOCTTY in order to make the slave become the controlling
+ * terminal.
*/
- ioctl(slave, I_PUSH, "ptem");
- ioctl(slave, I_PUSH, "ldterm");
+
+ switch (pid = fork()) {
+ case 0:
+ /* Child process */
+ setsid();
+
+ if ((slave = open(slavenam, O_RDWR)) < 0) {
+ close(master);
+ fatal(_("could not open `%s', mode `%s'"),
+ slavenam, "r+");
+ }
+
+#ifdef I_PUSH
+ /*
+ * Push the necessary modules onto the slave to
+ * get terminal semantics. Check that they aren't
+ * already there to avoid hangs on said "limited" systems.
+ */
+#ifdef I_FIND
+ if (ioctl(slave, I_FIND, "ptem") == 0)
#endif
+ ioctl(slave, I_PUSH, "ptem");
+#ifdef I_FIND
+ if (ioctl(slave, I_FIND, "ldterm") == 0)
+#endif
+ ioctl(slave, I_PUSH, "ldterm");
+#endif
+ tcgetattr(slave, & st);
- tcgetattr(slave, & st);
- st.c_iflag &= ~(ISTRIP | IGNCR | INLCR | IXOFF);
- st.c_iflag |= (ICRNL | IGNPAR | BRKINT | IXON);
- st.c_oflag &= ~OPOST;
- st.c_cflag &= ~CSIZE;
- st.c_cflag |= CREAD | CS8 | CLOCAL;
- st.c_lflag &= ~(ECHO | ECHOE | ECHOK | NOFLSH | TOSTOP);
- st.c_lflag |= ISIG;
+ st.c_iflag &= ~(ISTRIP | IGNCR | INLCR | IXOFF);
+ st.c_iflag |= (ICRNL | IGNPAR | BRKINT | IXON);
+ st.c_oflag &= ~OPOST;
+ st.c_cflag &= ~CSIZE;
+ st.c_cflag |= CREAD | CS8 | CLOCAL;
+ st.c_lflag &= ~(ECHO | ECHOE | ECHOK | NOFLSH | TOSTOP);
+ st.c_lflag |= ISIG;
- /* Set some control codes to default values */
+ /* Set some control codes to default values */
#ifdef VINTR
- st.c_cc[VINTR] = '\003'; /* ^c */
+ st.c_cc[VINTR] = '\003'; /* ^c */
#endif
#ifdef VQUIT
- st.c_cc[VQUIT] = '\034'; /* ^| */
+ st.c_cc[VQUIT] = '\034'; /* ^| */
#endif
#ifdef VERASE
- st.c_cc[VERASE] = '\177'; /* ^? */
+ st.c_cc[VERASE] = '\177'; /* ^? */
#endif
#ifdef VKILL
- st.c_cc[VKILL] = '\025'; /* ^u */
+ st.c_cc[VKILL] = '\025'; /* ^u */
#endif
#ifdef VEOF
- st.c_cc[VEOF] = '\004'; /* ^d */
+ st.c_cc[VEOF] = '\004'; /* ^d */
#endif
- tcsetattr(slave, TCSANOW, & st);
-
- switch (pid = fork()) {
- case 0:
- /* Child process */
- setsid();
#ifdef TIOCSCTTY
+ /*
+ * This may not necessary anymore given that we
+ * open the slave in the child, but it doesn't hurt.
+ */
ioctl(slave, TIOCSCTTY, 0);
#endif
+ tcsetattr(slave, TCSANOW, & st);
if (close(master) == -1)
fatal(_("close of master pty failed (%s)"), strerror(errno));
@@ -2047,13 +2066,6 @@ two_way_open(const char *str, struct redirect *rp, int extfd)
}
- /* parent */
- if (close(slave) != 0) {
- close(master);
- (void) kill(pid, SIGKILL);
- fatal(_("close of slave pty failed (%s)"), strerror(errno));
- }
-
rp->pid = pid;
rp->iop = iop_alloc(master, str, 0);
find_input_parser(rp->iop);
diff --git a/profile.c b/profile.c
index f5bcf8c5..d49dbbf9 100644
--- a/profile.c
+++ b/profile.c
@@ -1440,9 +1440,10 @@ pp_number(NODE *n)
{
#define PP_PRECISION 6
char *str;
- size_t count;
#ifdef HAVE_MPFR
+ size_t count;
+
if (is_mpg_float(n)) {
count = mpfr_get_prec(n->mpg_numbr) / 3; /* ~ 3.22 binary digits per decimal digit */
emalloc(str, char *, count, "pp_number");