Skip to content

Commit 68edd04

Browse files
authored
Merge pull request #1713 from neverxie/fix-pipe-bug
[components][pipe] Fix 'pipe' command close bug when open failed.
2 parents 2ec54ba + 3a83e55 commit 68edd04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/drivers/src/pipe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ int pipe(int fildes[2])
541541
fildes[1] = open(dev_name, O_WRONLY, 0);
542542
if (fildes[1] < 0)
543543
{
544-
close(fildes[1]);
544+
close(fildes[0]);
545545
return -1;
546546
}
547547

0 commit comments

Comments
 (0)