Bug #17097: exec() always reports -1- as the return value of the executed command
| From: | djanix at hotmail dot com | Date: | Wed, 08 May 2002 14:33:39 +0000 |
| Subject: | Bug #17097: exec() always reports -1- as the return value of the executed command | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-7246@lists.php.net to get a copy of this message | ||
From: djanix@hotmail.com
Operating system: win32
PHP version: 4.0CVS-2002-05-08
PHP Bug Type: Filesystem function related
Bug description: exec() always reports -1- as the return value of the executed command
testret.c i made... :
#include <stdio.h>
int main( int argc, char *argv[] )
{
return atol(argv[1]);
}
compiled that into testret.exe....
test.php i made... :
<?
exec( 'c:\testret.exe 3', $rlines, $rval );
var_dump( $rval );
?>
outputs...
int(1)
--------------------
i've traced through the source a bunch trying to find what changed that
broke it - my last build (worked fine) was from the cvs head sometime in
feb - so the big changes that affect exec() are the streams.
FG(pclose_ret) is not set correctly inside of exec() - i don't feel like
getting into the streams right now to find it and i assume someone on the
dev team has all of that fresh in their head and can probably find this
problem quickly :)
and it's obviously important since i'm sure many many people rely on
exec()...
-benjamin
--
Edit bug report at http://bugs.php.net/?id=17097&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17097&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17097&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17097&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17097&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17097&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17097&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17097&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17097&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17097&r=globals