bzopen_or_bzdopen() - Open files with O_CLOEXEC with the "e" mode
This commit is contained in:
parent
39fddb72e8
commit
cebe990273
10
bzlib.c
10
bzlib.c
@ -1414,8 +1414,14 @@ BZFILE * bzopen_or_bzdopen
|
||||
}
|
||||
mode++;
|
||||
}
|
||||
strcat(mode2, writing ? "w" : "r" );
|
||||
strcat(mode2,"b"); /* binary mode */
|
||||
|
||||
strcat(mode2, writing ? "wb" : "rb" );
|
||||
|
||||
/* open fds with O_CLOEXEC _only_ when we are the initiator
|
||||
* aka. bzopen() but not bzdopen() */
|
||||
if(open_mode == 0) {
|
||||
strcat (mode2, writing ? "e" : "e" );
|
||||
}
|
||||
|
||||
if (open_mode==0) {
|
||||
if (path==NULL || strcmp(path,"")==0) {
|
||||
|
@ -5,9 +5,3 @@ repository:
|
||||
bzip2-doc package instead of the bzip2.txt file from the source
|
||||
distribution. This is suitable for distributions which repackage
|
||||
the original files into different packages.
|
||||
|
||||
* bzip2-ocloexec.patch - Adds an "e" to the open mode string for
|
||||
fopen(), with the intention of using O_CLOEXEC for bzopen() but not
|
||||
for bzdopen(). This is a Linux-ism; maybe this needs to be done
|
||||
with fcntl() on other systems?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user