#48820 [Opn->Fbk]: ttyname_r() configure test unreliable

From: Date: Tue, 07 Jul 2009 15:34:32 +0000
Subject: #48820 [Opn->Fbk]: ttyname_r() configure test unreliable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139401@lists.php.net to get a copy of this message
ID: 48820 Updated by: jani@php.net Reported By: arekm at maven dot pl -Status: Open +Status: Feedback Bug Type: POSIX related Operating System: Linux PHP Version: 5.2.10, 5.3.0 New Comment: I feel a bit stupid for asking this..but how/why do you build in non terminal..? :) Previous Comments: ------------------------------------------------------------------------ [2009-07-06 16:22:29] arekm at maven dot pl Description: ------------ ttyname_r() check done in configure is wrong because it relies on doing build on a terminal. Building on non terminal causes failure. Reproduce code: --------------- This is test taken from configure: [arekm@t400 ~/test/3]$ more a.c #include <unistd.h> int main(int argc, char *argv[]) { char buf[64]; return ttyname_r(0, buf, 64) ? 1 : 0; } [arekm@t400 ~/test/3]$ gcc a.c [arekm@t400 ~/test/3]$ ./a.out [arekm@t400 ~/test/3]$ echo $? 0 success - we are on a terminal [arekm@t400 ~/test/3]$ ./a.out < /dev/null zsh: exit 1 ./a.out < /dev/null [arekm@t400 ~/test/3]$ echo $? 1 [arekm@t400 ~/test/3]$ failure - we are not on terminal ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48820&edit=1

« previous php.bugs (#139401) next »