[svn-commits] file: branch 1.4 r45595 - /branches/1.4/main/asterisk.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Oct 18 14:03:35 MST 2006


Author: file
Date: Wed Oct 18 16:03:34 2006
New Revision: 45595

URL: http://svn.digium.com/view/asterisk?rev=45595&view=rev
Log:
Don't modify things if we are using vfork as this is very bad and may cause unexpected behavior (issue #7970 reported by Nick Gavrikov)

Modified:
    branches/1.4/main/asterisk.c

Modified: branches/1.4/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/asterisk.c?rev=45595&r1=45594&r2=45595&view=diff
==============================================================================
--- branches/1.4/main/asterisk.c (original)
+++ branches/1.4/main/asterisk.c Wed Oct 18 16:03:34 2006
@@ -690,7 +690,9 @@
 int ast_safe_system(const char *s)
 {
 	pid_t pid;
+#ifdef HAVE_WORKING_FORK
 	int x;
+#endif
 	int res;
 	struct rusage rusage;
 	int status;
@@ -705,11 +707,13 @@
 #endif	
 
 	if (pid == 0) {
+#ifdef HAVE_WORKING_FORK
 		if (ast_opt_high_priority)
 			ast_set_priority(0);
 		/* Close file descriptors and launch system command */
 		for (x = STDERR_FILENO + 1; x < 4096; x++)
 			close(x);
+#endif
 		execl("/bin/sh", "/bin/sh", "-c", s, (char *) NULL);
 		exit(1);
 	} else if (pid > 0) {



More information about the svn-commits mailing list