Merge pull request #1713 from neverxie/fix-pipe-bug

[components][pipe] Fix 'pipe' command close bug when open failed.
This commit is contained in:
Bernard Xiong 2018-08-11 23:30:10 +08:00 committed by GitHub
commit 68edd04cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -541,7 +541,7 @@ int pipe(int fildes[2])
fildes[1] = open(dev_name, O_WRONLY, 0);
if (fildes[1] < 0)
{
close(fildes[1]);
close(fildes[0]);
return -1;
}