Explorar o código

make posix_spawn accept null pid pointer arguments

this is a requirement in the specification that was overlooked.
Rich Felker %!s(int64=11) %!d(string=hai) anos
pai
achega
8011614da0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/process/posix_spawn.c

+ 1 - 1
src/process/posix_spawn.c

@@ -166,7 +166,7 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path,
 
 	close(args.p[0]);
 
-	if (!ec) *res = pid;
+	if (!ec && res) *res = pid;
 
 	pthread_sigmask(SIG_SETMASK, &args.oldmask, 0);
 	pthread_setcancelstate(cs, 0);