Re: [Anjuta-list] Re: using execl().. how?



I looked on the code of your callback function.
You don't use the fork() function correctly.
fork() will create a new process returning 0 to the new process (the son) and the pid of the new process to the father. You need to test wether you are on the son or the father before calling execl. If not, you execute the program in the son and the father.

So instead of

fork();
execl(...);

it should be :

if(fork()==0) {
execl(...); // the son execute the new code
}
// this part is never executed by the son as the code had been overwritten
...


now this should be better

good luck

Fabrice


Luthfi wrote:

thanks.. i have tried using your advice, but it still doesn't work.
i forget whether the project close or an error message appear.

Luthfi

hi

I think that you don't use execl the right way.
As I remember, in execl, the first argument of the argument list is the
name of executable and the list ends with NULL.
In your case, this should be

execl("/Project/form1", "/Project/form1", NULL);

I hope this helps

Fabrice



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Anjuta-list mailing list
Anjuta-list lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/anjuta-list






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]