From 2e60256978c4a4e61a85e4629c1ff3884ac459b4 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 29 Jun 2019 15:24:01 +0300 Subject: [PATCH] mdbx: drop EPIPE/SIGPIPE handling (since pipes are disallowed). Change-Id: I56d4539333edea93cc1a2c3606cf959c82b98b19 --- src/mdbx.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index a1059ea2..4799cf1a 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -11283,23 +11283,6 @@ static THREAD_RESULT __cold THREAD_CALL mdbx_env_copythr(void *arg) { int rc; size_t offset = pgno2bytes(my->mc_env, NUM_METAS); -#if defined(F_SETNOSIGPIPE) - /* OS X delivers SIGPIPE to the whole process, not the thread that caused it. - * Disable SIGPIPE using platform specific fcntl. */ - int enabled = 1; - if (fcntl(my->mc_fd, F_SETNOSIGPIPE, &enabled)) - my->mc_error = errno; -#endif - -#if defined(SIGPIPE) && !defined(_WIN32) && !defined(_WIN64) - sigset_t set; - sigemptyset(&set); - sigaddset(&set, SIGPIPE); - rc = pthread_sigmask(SIG_BLOCK, &set, NULL); - if (rc != 0) - my->mc_error = rc; -#endif - mdbx_condmutex_lock(&my->mc_condmutex); while (!my->mc_error) { while (!my->mc_new) @@ -11312,14 +11295,6 @@ static THREAD_RESULT __cold THREAD_CALL mdbx_env_copythr(void *arg) { if (wsize > 0 && !my->mc_error) { rc = mdbx_pwrite(my->mc_fd, ptr, wsize, offset); if (rc != MDBX_SUCCESS) { -#if defined(SIGPIPE) && !defined(_WIN32) && !defined(_WIN64) - if (rc == EPIPE) { - /* Collect the pending SIGPIPE, otherwise (at least OS X) - * gives it to the process on thread-exit (ITS#8504). */ - int tmp; - sigwait(&set, &tmp); - } -#endif my->mc_error = rc; break; }