Skip to content

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

Description

@GoogleCodeExporter
       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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions