]> granicus.if.org Git - php/commitdiff
(shell_exec) use pclose for FILE* that has been opened via popen!
authorThies C. Arntzen <thies@php.net>
Wed, 13 Oct 1999 14:01:47 +0000 (14:01 +0000)
committerThies C. Arntzen <thies@php.net>
Wed, 13 Oct 1999 14:01:47 +0000 (14:01 +0000)
@- Fixed zombie problem in shell_exec() and $a = `some_command`
@  constructs. (Thies)

ext/standard/exec.c

index bdaa883bc9a4331acb624b2af63266dce95efca1..df59f58782924f1b0ad83a726f0ed23e3e54ac09 100644 (file)
@@ -398,7 +398,7 @@ PHP_FUNCTION(shell_exec)
                allocated_space = total_readbytes+EXEC_INPUT_BUF;
                return_value->value.str.val = (char *) erealloc(return_value->value.str.val,allocated_space);
        }
-       fclose(in);
+       pclose(in);
                
        return_value->value.str.val = erealloc(return_value->value.str.val,total_readbytes+1);
        return_value->value.str.val[total_readbytes]=0;