summaryrefslogtreecommitdiff
path: root/tests/tap/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tap/process.c')
-rw-r--r--tests/tap/process.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/tap/process.c b/tests/tap/process.c
index 6461fb4..8c22324 100644
--- a/tests/tap/process.c
+++ b/tests/tap/process.c
@@ -47,8 +47,11 @@
# include <sys/select.h>
#endif
#include <sys/stat.h>
-#include <sys/time.h>
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
#include <sys/wait.h>
+#include <time.h>
#include <tests/tap/basic.h>
#include <tests/tap/process.h>
@@ -229,6 +232,10 @@ process_free(struct process *process)
{
struct process **prev;
+ /* Do nothing if called with a NULL argument. */
+ if (process == NULL)
+ return;
+
/* Remove the process from the global list. */
prev = &processes;
while (*prev != NULL && *prev != process)