summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-09-04 01:04:33 -0400
committermidipix <writeonce@midipix.org>2016-09-05 00:07:15 -0400
commit819200628308694c4de3a90cb8b4ecdece1393e2 (patch)
treecad9c8997fe1b31bc4386d633438fe49bc62e02d /src
parent478d3f4985f15363709c7a93f9e66ba574abbf7e (diff)
downloadslibtool-819200628308694c4de3a90cb8b4ecdece1393e2.tar.bz2
slibtool-819200628308694c4de3a90cb8b4ecdece1393e2.tar.xz
slbt_spawn(): reset value of errno after successful child process creation.
Diffstat (limited to 'src')
-rw-r--r--src/internal/slibtool_spawn_impl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/internal/slibtool_spawn_impl.h b/src/internal/slibtool_spawn_impl.h
index 3966fcb..1abfbe9 100644
--- a/src/internal/slibtool_spawn_impl.h
+++ b/src/internal/slibtool_spawn_impl.h
@@ -7,6 +7,7 @@
#include <limits.h>
#include <unistd.h>
#include <stdbool.h>
+#include <errno.h>
#include <sys/wait.h>
#ifndef PATH_MAX
@@ -33,7 +34,6 @@ static inline int slbt_spawn(
{
pid_t pid;
-
#ifdef SLBT_USE_POSIX_SPAWN
if (posix_spawnp(
@@ -62,6 +62,7 @@ static inline int slbt_spawn(
ectx->program,
ectx->argv);
+ errno = 0;
ectx->pid = pid;
if (fwait)