FISH_USE_POSIX_SPAWN and HAVE_SPAWN_H fixes

FISH_USE_POSIX_SPAWN is always defined, thanks to the line

   #define FISH_USE_POSIX_SPAWN HAVE_SPAWN_H

So replace #ifdef with #if to fix compilation on platforms lacking
spawn.h. Also make the spawn.h inclusion condition consistent across
files.
This commit is contained in:
Evan Miller 2021-06-30 22:23:57 -04:00 committed by Fabian Homborg
parent 9f54c8d88b
commit 23518e7ad8
2 changed files with 3 additions and 3 deletions

@ -10,7 +10,7 @@
#include <cstring>
#include <memory>
#ifdef FISH_USE_POSIX_SPAWN
#ifdef HAVE_SPAWN_H
#include <spawn.h>
#endif
#include <cwchar>

@ -9,7 +9,7 @@
#include <unistd.h>
#include "maybe.h"
#if HAVE_SPAWN_H
#ifdef HAVE_SPAWN_H
#include <spawn.h>
#endif
#ifndef FISH_USE_POSIX_SPAWN
@ -53,7 +53,7 @@ pid_t execute_fork();
void safe_report_exec_error(int err, const char *actual_cmd, const char *const *argv,
const char *const *envv);
#ifdef FISH_USE_POSIX_SPAWN
#if FISH_USE_POSIX_SPAWN
/// A RAII type which wraps up posix_spawn's data structures.
class posix_spawner_t {
public: