#48820 [Com]: ttyname_r() configure test unreliable

From: Date: Tue, 07 Jul 2009 18:31:30 +0000
Subject: #48820 [Com]: ttyname_r() configure test unreliable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139431@lists.php.net to get a copy of this message
ID: 48820 Comment by: arekm at maven dot pl Reported By: arekm at maven dot pl Status: Feedback Bug Type: POSIX related Operating System: Linux PHP Version: 5.2.10, 5.3.0 New Comment: I'm building using rpm and it doesn't provide terminal as stdin to configure - ttyname_r() check fails. Previous Comments: ------------------------------------------------------------------------ [2009-07-07 15:34:31] jani@php.net I feel a bit stupid for asking this..but how/why do you build in non terminal..? :) ------------------------------------------------------------------------ [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 (#139431) next »