aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-05-27 23:33:47 -0700
committerGravatar GitHub <noreply@github.com> 2023-05-27 23:33:47 -0700
commit1388ec0d60e77cb0d71475fef33ab5764501b208 (patch)
tree738ff1c1382e4f3878db7826ece9b023095ce184 /src/bun.js
parent4ba3ed512ac8407603c99d56d931038e0bdf0884 (diff)
downloadbun-1388ec0d60e77cb0d71475fef33ab5764501b208.tar.gz
bun-1388ec0d60e77cb0d71475fef33ab5764501b208.tar.zst
bun-1388ec0d60e77cb0d71475fef33ab5764501b208.zip
Fixes #2356 (#3098)
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/bindings/c-bindings.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp
index 90cb5e310..0e837d04f 100644
--- a/src/bun.js/bindings/c-bindings.cpp
+++ b/src/bun.js/bindings/c-bindings.cpp
@@ -4,6 +4,7 @@
#include <unistd.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
+#include <sys/signal.h>
extern "C" int32_t get_process_priority(uint32_t pid)
{
@@ -34,3 +35,9 @@ extern "C" bool is_executable_file(const char* path)
// regular file and user can execute
return S_ISREG(st.st_mode) && (st.st_mode & S_IXUSR);
}
+
+extern "C" void bun_ignore_sigpipe()
+{
+ // ignore SIGPIPE
+ signal(SIGPIPE, SIG_IGN);
+} \ No newline at end of file