OSDN Git Service

mkostemp: fix implementation
authorAnthony G. Basile <blueness@gentoo.org>
Mon, 27 Oct 2014 20:13:34 +0000 (16:13 -0400)
committerWaldemar Brodkorb <wbx@openadk.org>
Wed, 10 Dec 2014 19:05:58 +0000 (13:05 -0600)
commit9649721950565d8a21a89017ac712257da644b75
tree2e1cdebaa7facd753767e89be3793766b97d2ddf
parent0cda37ffaf3cb7aec2c1c8b49e2a5b8f82255c3e
mkostemp: fix implementation

mkostemp(char *template, int flags) generates a unique temporary
filename from a template.  The flags parameter accepts three of
the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC.  The
current implementation of mkostemp(3) does not respect the flags
and in fact confuses the flags with the file mode which should
always be S_IRUSR | S_IWUSR.  This patch corrects this issue.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
17 files changed:
libc/inet/getaddrinfo.c
libc/misc/internals/tempname.c
libc/misc/internals/tempname.h
libc/stdio/tempnam.c
libc/stdio/tmpfile.c
libc/stdio/tmpnam.c
libc/stdio/tmpnam_r.c
libc/stdlib/mkdtemp.c
libc/stdlib/mkostemp.c
libc/stdlib/mkostemp64.c
libc/stdlib/mkstemp.c
libc/stdlib/mkstemp64.c
libc/stdlib/mktemp.c
libpthread/nptl/sem_open.c
test/.gitignore
test/stdlib/test-mkostemp-O_CLOEXEC.c [new file with mode: 0644]
test/stdlib/test-mkostemp-child.c [new file with mode: 0644]