fix open return check

Originally committed as revision 13858 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-06-22 00:33:08 +00:00
parent 0679719d5b
commit 3296409d5c
1 changed files with 4 additions and 4 deletions

View File

@ -392,12 +392,12 @@ static void start_children(FFStream *feed)
if (!ffserver_debug) {
i = open("/dev/null", O_RDWR);
if (i)
if (i != -1) {
dup2(i, 0);
dup2(i, 1);
dup2(i, 2);
if (i)
dup2(i, 1);
dup2(i, 2);
close(i);
}
}
av_strlcpy(pathname, my_program_name, sizeof(pathname));