]> granicus.if.org Git - php/commitdiff
eliminate chdir if it is already virtual
authorSam Ruby <rubys@php.net>
Thu, 30 Mar 2000 23:23:29 +0000 (23:23 +0000)
committerSam Ruby <rubys@php.net>
Thu, 30 Mar 2000 23:23:29 +0000 (23:23 +0000)
sapi/servlet/servlet.c

index 3546c61914e192df9f1df6210d3b4ddd4f7edfd2..5cc680f91d65ce5298a832ada8b6e0c33bba77fe 100644 (file)
@@ -365,9 +365,16 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
         * Parse the file
         */
        SETSTRING( SG(request_info).path_translated, pathTranslated );
+#ifdef VIRTUAL_DIR
+       file_handle.handle.fp = php_fopen_primary_script();
+#else
+        // The java runtime doesn't like the working directory to be
+        // changed, so save it and change it back as quickly as possible
+        // in the hopes that Java doesn't notice.
        getcwd(cwd,MAXPATHLEN);
        file_handle.handle.fp = php_fopen_primary_script();
        chdir(cwd);
+#endif
        file_handle.filename = SG(request_info).path_translated;
        file_handle.free_filename = 0;
        file_handle.type = ZEND_HANDLE_FP;