Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: disable buffering on std{out,err} #482

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ int tjs__load_file(JSContext *ctx, DynBuf *dbuf, const char *filename);
JSModuleDef *tjs_module_loader(JSContext *ctx, const char *module_name, void *opaque);
char *tjs_module_normalizer(JSContext *ctx, const char *base_name, const char *name, void *opaque);

JSModuleDef *js_init_module_std(JSContext *ctx, const char *module_name);
int js_module_set_import_meta(JSContext *ctx, JSValueConst func_val, JS_BOOL use_realpath, JS_BOOL is_main);

JSValue tjs__get_args(JSContext *ctx);
Expand Down
1 change: 0 additions & 1 deletion src/tjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "utils.h"

#include <quickjs.h>
#include <stdbool.h>

typedef struct TJSRuntime TJSRuntime;

Expand Down
4 changes: 4 additions & 0 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "tjs.h"

#include <signal.h>
#include <stdio.h>
#include <string.h>

#ifdef TJS__HAS_MIMALLOC
Expand Down Expand Up @@ -402,6 +403,9 @@ void TJS_Initialize(int argc, char **argv) {
tjs__argc = argc;
tjs__argv = uv_setup_args(argc, argv);

setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);

#ifdef SIGPIPE
signal(SIGPIPE, SIG_IGN);
#endif
Expand Down
Loading