]> granicus.if.org Git - php/commitdiff
Make exec() fwork on Unix again
authorStanislav Malyshev <stas@php.net>
Mon, 26 Jun 2000 17:12:38 +0000 (17:12 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 26 Jun 2000 17:12:38 +0000 (17:12 +0000)
ext/standard/exec.c

index 61bc6f21ce12959630d7543c50441c229f80c39a..7fc6acc033430c7657476e3efd6c13abe2529b17 100644 (file)
@@ -86,7 +86,11 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
                tmp = php_escape_shell_cmd(d);
                efree(d);
                d = tmp;
+#ifdef PHP_WIN32
                fp = V_POPEN(d, "rb");
+#else
+               fp = V_POPEN(d, "r");
+#endif
                if (!fp) {
                        php_error(E_WARNING, "Unable to fork [%s]", d);
                        efree(d);
@@ -94,7 +98,11 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
                        return -1;
                }
        } else { /* not safe_mode */
+#ifdef PHP_WIN32
                fp = V_POPEN(cmd, "rb");
+#else
+               fp = V_POPEN(cmd, "r");
+#endif
                if (!fp) {
                        php_error(E_WARNING, "Unable to fork [%s]", cmd);
                        efree(buf);