+ -
当前位置:首页 → 问答吧 → exec的一个问题

exec的一个问题

时间:2010-08-17

来源:互联网

if($pid == 0){
    exec(command);
    print("Shoud never run here.\n");
    exit(1);
}

如果我不写后面的exit(1)的话,那么当command不能执行的时候,子进程就会往下执行父进程的代码。这样写又给我一个警告:
statement unlikely to be reached at  xx line xx.
Maybe you meant system() when you said exec.

作者: yecheng_110   发布时间: 2010-08-17

if($pid == 0)
{
    no warnings;
    exec(command);
    print("Shoud never run here.\n");
    exit(1);
}

作者: 黑色阳光_cu   发布时间: 2010-08-17



QUOTE:
if($pid == 0)
{
    no warnings;
    exec(command);
    print("Shoud never run here.\n"
    e ...
黑色阳光_cu 发表于 2010-08-17 09:38




    谢谢

作者: yecheng_110   发布时间: 2010-08-17