pollita Fri Jan 5 20:01:44 2007 UTC Modified files: /php-src/ext/posix posix.c Log: BSD4.1 (possibly others) doesn't support _SC_TTY_NAME_MAX http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.85&r2=1.86&diff_format=u Index: php-src/ext/posix/posix.c diff -u php-src/ext/posix/posix.c:1.85 php-src/ext/posix/posix.c:1.86 --- php-src/ext/posix/posix.c:1.85 Mon Jan 1 09:29:28 2007 +++ php-src/ext/posix/posix.c Fri Jan 5 20:01:44 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: posix.c,v 1.85 2007/01/01 09:29:28 sebastian Exp $ */ +/* $Id: posix.c,v 1.86 2007/01/05 20:01:44 pollita Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -147,7 +147,7 @@ static PHP_MINFO_FUNCTION(posix) { php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision: 1.85 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.86 $"); php_info_print_table_end(); } /* }}} */ @@ -575,7 +575,12 @@ fd = Z_LVAL_PP(z_fd); } #if HAVE_TTYNAME_R +#ifdef _SC_TTY_NAME_MAX buflen = sysconf(_SC_TTY_NAME_MAX); +#else + /* Arbitrary buffer size for systems which don't extrospect their tty name lengths, way overkill */ + buflen = 64; +#endif p = emalloc(buflen); if (ttyname_r(fd, p, buflen)) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php