zhangziran/httpsqs

C客户端守护进程初始化有问题

Opened this issue · 0 comments

       if(pid = fork())
                exit(0);
        else if(pid < 0)
                exit(1);
pid=fork() 
当返回值是-1时条件也是成立的,虽然能正常工作。但不够严
谨。

建议这样处理:

if((pid = fork()) >0)
                exit(0);
        else if(pid < 0)
                exit(1);

Original issue reported on code.google.com by lanwent...@gmail.com on 27 May 2013 at 1:29