From: <lpa...@us...> - 2013-10-19 22:48:06
|
Revision: 8893 http://sourceforge.net/p/planeshift/code/8893 Author: lpancallo Date: 2013-10-19 22:48:03 +0000 (Sat, 19 Oct 2013) Log Message: ----------- sample with sys_fork() Modified Paths: -------------- trunk/src/client/crashreport.cpp Modified: trunk/src/client/crashreport.cpp =================================================================== --- trunk/src/client/crashreport.cpp 2013-10-19 22:26:08 UTC (rev 8892) +++ trunk/src/client/crashreport.cpp 2013-10-19 22:48:03 UTC (rev 8893) @@ -265,10 +265,22 @@ //printf ("descriptor %s\n",uploadBuffer); //execl( "./pslaunch", uploadBuffer, NULL ); - printf ("before\n"); - execl( "/bin/ls", 0 ); - printf ("done\n"); - return true; + pid_t pid = sys_fork(); + printf ("pid %d \n",pid); + if (pid == 0) { + printf ("the first process. exit\n"); + printf ("before\n"); + //execl( "/bin/ls", 0 ); + printf ("done\n"); + return false; + } else { + printf ("I'm the new process\n"); + return true; + } + + exit(1); + + return true; const char* dump_path = descriptor.path(); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |