소스 검색

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

[components][pipe] Fix 'pipe' command close bug when open failed.
Bernard Xiong 6 년 전
부모
커밋
68edd04cbb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      components/drivers/src/pipe.c

+ 1 - 1
components/drivers/src/pipe.c

@@ -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;
     }