[syslog-ng]problem with syslog-ng fork & exec

niraj syslog-ng@lists.balabit.hu
31 Mar 2005 12:28:17 +0530


I m facing problem with this code . 
When I execute this program it forks 2 process 
 A zombie syslog-ng process on the forked ID
 syslog-ng on the next pid 

but without while loop every thing is working properly

TIA
niraj


#include<iostream>
#include<unistd.h>
using namespace std;
int main()
{
int cpid;
cpid=fork();
  if(cpid==0)
  {
    if(execv( "/usr/local/sbin/syslog-ng" ,NULL)==-1)
     {
      cout<<"hello"<<endl;
     }
  cout<<"ok"<<endl;
 }
while(1)
{
;
 }
return 0;
}
~
~