From e013381e720f569560453c28c42997297185948e Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 10 May 2020 21:06:52 -0500 Subject: [PATCH] Conditionally ignore pclose as well as popen. --- meson.build | 2 +- src/conf/janetconf.h | 6 +++--- src/core/io.c | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index c9d7d475..1a678519 100644 --- a/meson.build +++ b/meson.build @@ -20,7 +20,7 @@ project('janet', 'c', default_options : ['c_std=c99', 'b_lundef=false', 'default_library=both'], - version : '1.9.0') + version : '1.9.1-dev') # Global settings janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet') diff --git a/src/conf/janetconf.h b/src/conf/janetconf.h index c4e68c17..e4893009 100644 --- a/src/conf/janetconf.h +++ b/src/conf/janetconf.h @@ -28,9 +28,9 @@ #define JANET_VERSION_MAJOR 1 #define JANET_VERSION_MINOR 9 -#define JANET_VERSION_PATCH 0 -#define JANET_VERSION_EXTRA "" -#define JANET_VERSION "1.9.0" +#define JANET_VERSION_PATCH 1 +#define JANET_VERSION_EXTRA "-dev" +#define JANET_VERSION "1.9.1-dev" /* #define JANET_BUILD "local" */ diff --git a/src/core/io.c b/src/core/io.c index 28e2805f..e3be5c8f 100644 --- a/src/core/io.c +++ b/src/core/io.c @@ -253,7 +253,9 @@ static int cfun_io_gc(void *p, size_t len) { if (!(iof->flags & (JANET_FILE_NOT_CLOSEABLE | JANET_FILE_CLOSED))) { /* We can't panic inside a gc, so just ignore bad statuses here */ if (iof->flags & JANET_FILE_PIPED) { +#ifndef JANET_NO_PROCESSES pclose(iof->file); +#endif } else { fclose(iof->file); } @@ -270,10 +272,12 @@ static Janet cfun_io_fclose(int32_t argc, Janet *argv) { if (iof->flags & (JANET_FILE_NOT_CLOSEABLE)) janet_panic("file not closable"); if (iof->flags & JANET_FILE_PIPED) { +#ifndef JANET_NO_PROCESSES int status = pclose(iof->file); iof->flags |= JANET_FILE_CLOSED; if (status == -1) janet_panic("could not close file"); return janet_wrap_integer(WEXITSTATUS(status)); +#endif } else { if (fclose(iof->file)) janet_panic("could not close file"); iof->flags |= JANET_FILE_CLOSED;