php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67188 phpdbg_utils.c needs termio.h
Submitted: 2014-05-03 10:32 UTC Modified: 2014-12-30 14:07 UTC
From: rainer dot jung at kippdata dot de Assigned: tyrael (profile)
Status: Closed Package: phpdbg
PHP Version: 5.6.0beta2 OS: Solaris 10 Sparc
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rainer dot jung at kippdata dot de
New email:
PHP Version: OS:

 

 [2014-05-03 10:32 UTC] rainer dot jung at kippdata dot de
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-06 08:38 UTC] johannes@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: krakjoe
 [2014-06-22 17:05 UTC] tyrael@php.net
-Assigned To: krakjoe +Assigned To: tyrael
 [2014-06-22 17:05 UTC] tyrael@php.net
after fixing #67212 the compilation should finish, albeit we would fallback to the default terminal width (80).
I'm not sure it is worth the trouble for adding additional HAVE_TERMIO_H checks, considering that termio.h isn't posix compliant, and solaris 11 is out for a while now(and has termios.h).
what do you think?
 [2014-07-02 19:45 UTC] tyrael@php.net
-Status: Assigned +Status: Feedback
 [2014-12-30 10:42 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2014-12-30 14:07 UTC] rainer dot jung at kippdata dot de
-Status: No Feedback +Status: Closed
 [2014-12-30 14:07 UTC] rainer dot jung at kippdata dot de
Sorry for taking so long to respond: the current solution seems OK to me.
Since the Status field only allows values "Re-Opened" and "Closed", I'm setting it to "Closed".
Thank you!
Rainer
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 21:01:27 2024 UTC