Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
bb08f638
Commit
bb08f638
authored
Oct 20, 2016
by
Hallvard Furuseth
Browse files
ITS#8504 Fix prev commit: mc_error, #ifdef SIGPIPE
Never clear mc_error, we could lose a failure in the other thread.
parent
894e88bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
bb08f638
...
...
@@ -8996,17 +8996,17 @@ mdb_env_copythr(void *arg)
#define DO_WRITE(rc, fd, ptr, w2, len) rc = WriteFile(fd, ptr, w2, &len, NULL)
#else
int
len
;
sigset_t
set
;
#define DO_WRITE(rc, fd, ptr, w2, len) len = write(fd, ptr, w2); rc = (len >= 0)
#ifdef SIGPIPE
sigset_t
set
;
sigemptyset
(
&
set
);
sigaddset
(
&
set
,
SIGPIPE
);
if
((
rc
=
pthread_sigmask
(
SIG_BLOCK
,
&
set
,
NULL
))
!=
0
)
my
->
mc_error
=
rc
;
#endif
#endif
pthread_mutex_lock
(
&
my
->
mc_mutex
);
#ifndef _WIN32
my
->
mc_error
=
pthread_sigmask
(
SIG_BLOCK
,
&
set
,
NULL
);
#endif
for
(;;)
{
while
(
!
my
->
mc_new
)
pthread_cond_wait
(
&
my
->
mc_cond
,
&
my
->
mc_mutex
);
...
...
@@ -9020,8 +9020,11 @@ again:
DO_WRITE
(
rc
,
my
->
mc_fd
,
ptr
,
wsize
,
len
);
if
(
!
rc
)
{
rc
=
ErrCode
();
#if
n
def
_WIN32
#if
def
ined(SIGPIPE) && !defined(
_WIN32
)
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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment