فهرست منبع

don't fail posix_spawn on failed close

the resolution of austin group issue #370 removes the requirement that
posix_spawn fail when the close file action is performed on an
already-closed fd. since there are no other meaningful errors for
close, just ignoring the return value completely is the simplest fix.
Rich Felker 10 سال پیش
والد
کامیت
1c12c24364
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      src/process/posix_spawn.c

+ 1 - 2
src/process/posix_spawn.c

@@ -102,8 +102,7 @@ static int child(void *args_vp)
 			}
 			switch(op->cmd) {
 			case FDOP_CLOSE:
-				if ((ret=__syscall(SYS_close, op->fd)))
-					goto fail;
+				__syscall(SYS_close, op->fd);
 				break;
 			case FDOP_DUP2:
 				if ((ret=__sys_dup2(op->srcfd, op->fd))<0)