Bug #67188 [NEW]: phpdbg_utils.c needs termio.h
| From: | rainer dot jung at kippdata dot de | Date: | Sat, 03 May 2014 10:32:54 +0000 |
| Subject: | Bug #67188 [NEW]: phpdbg_utils.c needs termio.h | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185598@lists.php.net to get a copy of this message | ||
From: rainer dot jung at kippdata dot de
Operating system: Solaris 10 Sparc
PHP version: 5.6.0beta2
Package: phpdbg
Bug Type: Bug
Bug description:phpdbg_utils.c needs termio.h
Description:
------------
The new function phpdbg_get_terminal_width() in phpdbg_utils.c needs
#include <termio.h>
on Solaris 10. Otherwise compilations stops with:
.../phpdbg_utils.c: In function 'phpdbg_get_terminal_width':
.../phpdbg_utils.c:444:17: error: storage size of 'w' isn't known
.../phpdbg_utils.c:446:34: error: 'TIOCGWINSZ' undeclared (first use in
this function)
The code is only used when HAVE_SYS_IOCTL_H is set. I suggest to add a
configure test for HAVE_TERMIO_H and is both are defined add
#include <termio.h>
Patch would be
--- sapi/phpdbg/phpdbg_utils.c 2014-05-01 16:42:03.000000000 +0200
+++ sapi/phpdbg/phpdbg_utils.c 2014-05-03 12:27:23.964463000 +0200
@@ -32,6 +32,9 @@
# include "win32/time.h"
#elif defined(HAVE_SYS_IOCTL_H)
# include "sys/ioctl.h"
+#ifdef HAVE_TERMIO_H
+# include "termio.h"
+#endif
#endif
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
Needed Autofoo adjustments probably (untested):
--- configure.in 2014-05-01 16:42:03.000000000 +0200
+++ configure.in 2014-05-03 12:30:32.696237000 +0200
@@ -518,6 +518,7 @@
sys/varargs.h \
sys/wait.h \
sys/loadavg.h \
+termio.h \
termios.h \
unistd.h \
unix.h \
--- main/php_config.h.in 2014-05-02 00:05:58.000000000 +0200
+++ main/php_config.h.in 2014-05-03 12:30:49.051849000 +0200
@@ -1921,6 +1921,9 @@
/* Define to 1 if you have the `tempnam' function. */
#undef HAVE_TEMPNAM
+/* Define to 1 if you have the <termio.h> header file. */
+#undef HAVE_TERMIO_H
+
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
Test script:
---------------
No test script, compilation already fails.
--
Edit bug report at https://bugs.php.net/bug.php?id=67188&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67188&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67188&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67188&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67188&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67188&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67188&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67188&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67188&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67188&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67188&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67188&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67188&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67188&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67188&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67188&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67188&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67188&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67188&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67188&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67188&r=mysqlcfg