bzopen_or_bzdopen() - Open files with O_CLOEXEC with the "e" mode

parent 39fddb72
......@@ -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?
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment