diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c index af98062a94c..f3a1cc95ada 100644 --- a/libiberty/pex-unix.c +++ b/libiberty/pex-unix.c @@ -695,6 +695,7 @@ pex_unix_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, { *err = ret; *errmsg = "posix_spawnp"; + pid = -1; /* The value of pid is unspecified on failure. */ goto exit; } } @@ -705,6 +706,7 @@ pex_unix_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, { *err = ret; *errmsg = "posix_spawn"; + pid = -1; goto exit; } }