소스 검색

fix missing errno from exec failure in posix_spawn

failures prior to the exec attempt were reported correctly, but on
exec failure, the return value contained junk.
Rich Felker 11 년 전
부모
커밋
65d7aa4dfd
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/process/posix_spawn.c

+ 1 - 0
src/process/posix_spawn.c

@@ -105,6 +105,7 @@ static int child(void *args_vp)
 		? &attr->__mask : &args->oldmask, 0);
 
 	args->exec(args->path, args->argv, args->envp);
+	ret = -errno;
 
 fail:
 	/* Since sizeof errno < PIPE_BUF, the write is atomic. */