r1901 - in trunk/user/pixil

dslinux_amadeus at dslinux.in-berlin.de dslinux_amadeus at dslinux.in-berlin.de
Sun Sep 16 13:30:03 CEST 2007


Author: amadeus
Date: 2007-09-16 13:29:57 +0200 (Sun, 16 Sep 2007)
New Revision: 1901

Log:
Change fork() to vfork() where possible.

Modified: trunk/user/pixil/apps/fltk/netconfig/ip_setup.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/netconfig/ip_setup.cxx	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/apps/fltk/netconfig/ip_setup.cxx	2007-09-16 11:29:57 UTC (rev 1901)
@@ -582,7 +582,7 @@
 
     //bool have_dev_eth0 = get_have_dev_eth0_value();
 
-    if ((childpid = fork()) == -1) {
+    if ((childpid = vfork()) == -1) {
 	perror("net_down (FORK)");
 	return (PIX_COMM_ERROR);
     } else if (childpid == 0) {
@@ -629,7 +629,7 @@
     int idx;
 
 
-    if ((childpid = fork()) == -1) {
+    if ((childpid = vfork()) == -1) {
 	perror("net_down (FORK)");
 	return (PIX_COMM_ERROR);
     } else if (childpid == 0) {

Modified: trunk/user/pixil/apps/fltk/schedule/nxschedule.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/schedule/nxschedule.cxx	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/apps/fltk/schedule/nxschedule.cxx	2007-09-16 11:29:57 UTC (rev 1901)
@@ -1503,7 +1503,7 @@
     args[1] = buf;
     args[2] = "100";
     args[3] = NULL;
-    if ((childpid = fork()) == 0) {
+    if ((childpid = vfork()) == 0) {
 	execv(wave_path, args);
     }
 }

Modified: trunk/user/pixil/apps/nanox/misc/nxterm.c
===================================================================
--- trunk/user/pixil/apps/nanox/misc/nxterm.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/apps/nanox/misc/nxterm.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -1098,7 +1098,7 @@
     }
     signal(SIGCHLD, sigchild);
     signal(SIGINT,  sigchild);
-    if ((pid = fork()) == -1) {
+    if ((pid = vfork()) == -1) {
 	fprintf(stderr, "No processes\n");
 	return -1;
     }

Modified: trunk/user/pixil/libs/flnx/test/connect.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/connect.cxx	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/libs/flnx/test/connect.cxx	2007-09-16 11:29:57 UTC (rev 1901)
@@ -49,7 +49,7 @@
 void cb(Fl_Widget *o, void *) {
   if (((Fl_Toggle_Button*)o)->value()) {
     if (running) return;
-    running = fork();
+    running = vfork();
     if (!running) execl("/usr/sbin/pppd","pppd","-detach",0);
     else signal(SIGCHLD, sigchld);
   } else {

Modified: trunk/user/pixil/libs/pim/nxapp.cxx
===================================================================
--- trunk/user/pixil/libs/pim/nxapp.cxx	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/libs/pim/nxapp.cxx	2007-09-16 11:29:57 UTC (rev 1901)
@@ -2755,7 +2755,7 @@
     check_for_keyboard(GR_ROOT_WINDOW_ID);
 
     if (!keyboard_running) {
-	if ((childpid = fork()) == -1) {
+	if ((childpid = vfork()) == -1) {
 	    perror("NxApp::launch_keyboard (FORK FAILED)");
 	    return (-1);
 	} else if (childpid == 0) {

Modified: trunk/user/pixil/libs/pim/nxapp.new
===================================================================
--- trunk/user/pixil/libs/pim/nxapp.new	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/libs/pim/nxapp.new	2007-09-16 11:29:57 UTC (rev 1901)
@@ -2647,7 +2647,7 @@
     check_for_keyboard(GR_ROOT_WINDOW_ID);
 
     if (!keyboard_running) {
-	if ((childpid = fork()) == -1) {
+	if ((childpid = vfork()) == -1) {
 	    perror("NxApp::launch_keyboard (FORK FAILED)");
 	    return (-1);
 	} else if (childpid == 0) {

Modified: trunk/user/pixil/libs/pixlib/linux_if.c
===================================================================
--- trunk/user/pixil/libs/pixlib/linux_if.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/libs/pixlib/linux_if.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -450,7 +450,7 @@
     int child_status;
     int idx;
 
-    if ((childpid = fork()) == -1) {
+    if ((childpid = vfork()) == -1) {
 	perror("IF_DHCP (FORK)");
 	return (PIX_COMM_ERROR);
     } else if (childpid == 0)	// in child
@@ -497,7 +497,7 @@
     else
 	flags &= ~IFF_UP;
 
-    if ((childpid = fork()) == -1) {
+    if ((childpid = vfork()) == -1) {
 	perror("IF_DHCP (FORK)");
 	return (PIX_COMM_ERROR);
     } else if (childpid == 0)	// in child

Modified: trunk/user/pixil/libs/pixlib/linux_ppp.c
===================================================================
--- trunk/user/pixil/libs/pixlib/linux_ppp.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/libs/pixlib/linux_ppp.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -335,7 +335,7 @@
 	strcat(pptr, ipaddr);
     }
 
-    if ((childpid = fork()) == -1) {
+    if ((childpid = vfork()) == -1) {
 	perror("PPP_MODEM_CONNECT (FORK)");
 	return (PIX_COMM_ERROR);
     } else if (childpid == 0) {	// in child
@@ -459,7 +459,7 @@
 	strcat(pptr, "'");
     }
     /* Fire away! */
-    if ((childpid = fork()) == -1) {
+    if ((childpid = vfork()) == -1) {
 	perror("PPP_MODEM_CONNECT (FORK)");
 	return (PIX_COMM_ERROR);
     } else if (childpid == 0) {	// in child

Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/kscreensave.C
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/kscreensave.C	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/kscreensave.C	2007-09-16 11:29:57 UTC (rev 1901)
@@ -59,7 +59,7 @@
 		QString buffer = QString(KApplication::kde_bindir().data());
 		buffer.append("/kblankscrn.kss");
 	    
-		if ( fork() == 0 )
+		if ( vfork() == 0 )
 		{
 			execlp( buffer, buffer, "-install", "-delay", "0", "-lock", root, 0 );
 

Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kapp.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kapp.cpp	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kapp.cpp	2007-09-16 11:29:57 UTC (rev 1901)
@@ -1421,7 +1421,7 @@
 
 void KApplication::invokeHTMLHelp( QString filename, QString topic ) const
 {
-  if ( fork() == 0 )	
+  if ( vfork() == 0 )	
     {		
 	  if( filename.isEmpty() )
 	    filename = aAppName + "/index.html";

Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kprocess.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kprocess.cpp	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kprocess.cpp	2007-09-16 11:29:57 UTC (rev 1901)
@@ -237,7 +237,7 @@
     debug("Could not setup Communication!");
 
   runs = TRUE;
-  pid = fork();
+  pid = vfork();
 
   if (0 == pid) {
 	// The child process
@@ -689,7 +689,7 @@
     debug("Could not setup Communication!");
 
   runs = TRUE;
-  pid = fork();
+  pid = vfork();
 
   if (0 == pid) {
 	// The child process

Modified: trunk/user/pixil/packages/viewml/viewml/kdeui/kquickhelp.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdeui/kquickhelp.cpp	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/packages/viewml/viewml/kdeui/kquickhelp.cpp	2007-09-16 11:29:57 UTC (rev 1901)
@@ -232,7 +232,7 @@
     {
       // lets give this URL to kfm, he knows better what
       // to do with it
-      if(fork() > 0) {
+      if(vfork() > 0) {
 	// drop setuid, setgid
 	setgid(getgid());
 	setuid(getuid());

Modified: trunk/user/pixil/packages/viewml/viewml/src/html.moc
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/html.moc	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/packages/viewml/viewml/src/html.moc	2007-09-16 11:29:57 UTC (rev 1901)
@@ -721,7 +721,7 @@
   }
 
   // spawn the new process
-  pid = fork();
+  pid = vfork();
   if(pid != 0)
   {
     return;

Modified: trunk/user/pixil/pixilDT/src/PixilMainWnd.cpp
===================================================================
--- trunk/user/pixil/pixilDT/src/PixilMainWnd.cpp	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/pixilDT/src/PixilMainWnd.cpp	2007-09-16 11:29:57 UTC (rev 1901)
@@ -1131,7 +1131,7 @@
 	return;
 
     sprintf(cmd_line, "%s/push.sh", pixil_bin);
-    int pid = fork();
+    int pid = vfork();
 
     if (!pid) {
 	execl(cmd_line, cmd_line, 0);
@@ -1156,7 +1156,7 @@
 
     sprintf(cmd_line, "%s/pull.sh", pixil_bin);
 
-    int pid = fork();
+    int pid = vfork();
 
     if (!pid) {
 	execl(cmd_line, cmd_line, 0);

Modified: trunk/user/pixil/pixilDT/src/Sync.cpp
===================================================================
--- trunk/user/pixil/pixilDT/src/Sync.cpp	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/pixilDT/src/Sync.cpp	2007-09-16 11:29:57 UTC (rev 1901)
@@ -530,7 +530,7 @@
 	return -1;
     }
 
-    if (!(sync_pid = fork())) {	/* Child */
+    if (!(sync_pid = vfork())) {	/* Child */
 	dup2(outfd[0], 0);	/* Parent outgoing goes into child stdin */
 	dup2(infd[1], 1);	/* Parent incoming comes from child stdout */
 

Modified: trunk/user/pixil/sys/ipc/server/app.c
===================================================================
--- trunk/user/pixil/sys/ipc/server/app.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/sys/ipc/server/app.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -196,7 +196,7 @@
 
     local_parseArgs(exec, astr, &argv);
 
-    if (!(pid = fork())) {
+    if (!(pid = vfork())) {
 	char *path = 0;
 	/* If a work dir was specified, use that one */
 

Modified: trunk/user/pixil/sys/ipc/server/server.c
===================================================================
--- trunk/user/pixil/sys/ipc/server/server.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/sys/ipc/server/server.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -331,7 +331,7 @@
 	    cl_daemon = 1;
 
 	    /* Fork us away - This will esentially make a connectionless client */
-	    if (fork())
+	    if (vfork())
 		return (0);
 
 	    /* Redirect the terminal */

Modified: trunk/user/pixil/sys/pixilwm/exec.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/exec.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/sys/pixilwm/exec.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -240,7 +240,7 @@
     if (!argc)
 	return (-1);
 
-    if (!(pid = fork())) {
+    if (!(pid = vfork())) {
 	if (strlen(workdir))
 	    if (chdir(workdir))
 		error("Unable to switch to working directory '%s'.\n",

Modified: trunk/user/pixil/sys/pixilwm/keyb.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/keyb.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/sys/pixilwm/keyb.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -141,7 +141,7 @@
 	} else {
 	    GrUnmapWindow(p->m_container_wid);
 	}
-    } else if (!(p->m_process_id = fork())) {
+    } else if (!(p->m_process_id = vfork())) {
 	printf("execing %s\n", p->m_exec);
 	/* Set up the keyboard environment for execvp */
 	if (!kymap[0] && !kyword[0]) {

Modified: trunk/user/pixil/sys/pixilwm/scrib.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/scrib.c	2007-09-16 04:39:59 UTC (rev 1900)
+++ trunk/user/pixil/sys/pixilwm/scrib.c	2007-09-16 11:29:57 UTC (rev 1901)
@@ -122,7 +122,7 @@
 	} else {
 	    GrUnmapWindow(p->m_container_wid);
 	}
-    } else if (!(p->m_process_id = fork())) {
+    } else if (!(p->m_process_id = vfork())) {
 	printf("execing %s\n", p->m_exec);
 	execlp(p->m_exec, p->m_exec, 0);
 	exit(0);




More information about the dslinux-commit mailing list