diff options
author | 2019-03-10 22:21:27 +0530 | |
---|---|---|
committer | 2019-03-10 22:40:11 +0530 | |
commit | ed724dfd0cc9aa4b31b1f5ef1b2671e8e9a04468 (patch) | |
tree | 3b15152ac1ed64d5ff1a87a70e856320370e444d | |
parent | 085483ff6d371cbb5757f00239ba2c085c8eac63 (diff) | |
download | nnn-ed724dfd0cc9aa4b31b1f5ef1b2671e8e9a04468.tar.gz |
Fix build break
-rw-r--r-- | src/nnn.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -343,9 +343,14 @@ static uchar g_crc; static uchar BLK_SHIFT = 9; static bool interrupted = FALSE; -/* Signal handler related */ +/* Retain old signal handlers */ +#ifdef __linux__ static sighandler_t oldsighup; /* old value of hangup signal */ static sighandler_t oldsigtstp; /* old value of SIGTSTP */ +#else +static sig_t oldsighup; +static sig_t oldsigtstp; +#endif /* For use in functions which are isolated and don't return the buffer */ static char g_buf[CMD_LEN_MAX] __attribute__ ((aligned)); @@ -1091,8 +1096,8 @@ static void spawn(char *file, char *arg1, char *arg2, const char *dir, uchar fla pid = xfork(flag); if (pid == 0) { - if (dir) - status = chdir(dir); + if (dir && chdir(dir) == -1) + _exit(1); /* Suppress stdout and stderr */ if (flag & F_NOTRACE) { |