version 1.14, 2009/10/27 23:59:37 |
version 1.15, 2011/01/10 20:59:42 |
|
|
int r, tfd; |
int r, tfd; |
|
|
(void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf); |
(void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf); |
#ifndef HAVE_MKSTEMP |
|
{ |
|
char *ptr = mktemp(buf); |
|
tfd = open(ptr, O_RDWR|O_TRUNC|O_EXCL|O_CREAT, 0600); |
|
r = errno; |
|
(void)unlink(ptr); |
|
errno = r; |
|
} |
|
#else |
|
tfd = mkstemp(buf); |
tfd = mkstemp(buf); |
r = errno; |
r = errno; |
(void)unlink(buf); |
(void)unlink(buf); |
errno = r; |
errno = r; |
#endif |
|
if (tfd == -1) { |
if (tfd == -1) { |
file_error(ms, errno, |
file_error(ms, errno, |
"cannot create temporary file for pipe copy"); |
"cannot create temporary file for pipe copy"); |