svn commit: trunk/busybox/networking

vda at busybox.net vda at busybox.net
Fri Feb 8 15:21:56 UTC 2008


Author: vda
Date: 2008-02-08 07:21:55 -0800 (Fri, 08 Feb 2008)
New Revision: 20961

Log:
httpd: add a bit of error logging; a few code simplifications. +29 bytes.



Modified:
   trunk/busybox/networking/httpd.c


Changeset:
Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2008-02-08 15:04:00 UTC (rev 20960)
+++ trunk/busybox/networking/httpd.c	2008-02-08 15:21:55 UTC (rev 20961)
@@ -1419,8 +1419,9 @@
 
 		/* script must have absolute path */
 		script = strrchr(fullpath, '/');
-		if (!script)
-			goto error_execing_cgi;
+		//fullpath is a result of concat_path_file and always has '/'
+		//if (!script)
+		//	goto error_execing_cgi;
 		*script = '\0';
 		/* chdiring to script's dir */
 		if (chdir(fullpath) == 0) {
@@ -1441,16 +1442,19 @@
 #endif
 			*script = '/';
 			/* set argv[0] to name without path */
-			argv[0] = (char*)bb_basename(purl);
+			argv[0] = script + 1;
 			argv[1] = NULL;
 #if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
 			if (interpr)
-				execv(interpr, argv);
-			else
+				fullpath = interpr;
 #endif
-				execv(fullpath, argv);
+			execv(fullpath, argv);
+			if (verbose)
+				bb_perror_msg("exec %s", fullpath);
+		} else if (verbose) {
+			bb_perror_msg("chdir %s", fullpath);
 		}
- error_execing_cgi:
+ //error_execing_cgi:
 		/* send to stdout
 		 * (we are CGI here, our stdout is pumped to the net) */
 		send_headers_and_exit(HTTP_NOT_FOUND);




More information about the busybox-cvs mailing list