summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_utils.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-06-20 12:01:47 +0200
committerOndřej Surý <ondrej@sury.org>2014-06-20 12:01:47 +0200
commit60d44b592c4c4fdcbbf92db2882a97a9cc54713c (patch)
tree58f7068d9acde2338841263461fbf95d77a9ee2e /sapi/phpdbg/phpdbg_utils.c
parentc63e1a09f5cbd757f59beb729fb0fb36516819a9 (diff)
downloadphp-60d44b592c4c4fdcbbf92db2882a97a9cc54713c.tar.gz
New upstream version 5.6.0~rc1+dfsgupstream/5.6.0_rc1+dfsg
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.c')
-rw-r--r--sapi/phpdbg/phpdbg_utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index c9b22a203..98748b202 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -32,6 +32,9 @@
# include "win32/time.h"
#elif defined(HAVE_SYS_IOCTL_H)
# include "sys/ioctl.h"
+# ifndef GWINSZ_IN_SYS_IOCTL
+# include <termios.h>
+# endif
#endif
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -437,12 +440,12 @@ PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
-#elif defined(HAVE_SYS_IOCTL_H)
+#elif defined(HAVE_SYS_IOCTL_H) && defined (TIOCGWINSZ)
struct winsize w;
- columns = ioctl(fileno(stdout), TIOCGWINSZ, &w) == 0 ? w.ws_col : 100;
+ columns = ioctl(fileno(stdout), TIOCGWINSZ, &w) == 0 ? w.ws_col : 80;
#else
- columns = 100;
+ columns = 80;
#endif
return columns;
} /* }}} */