projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Get rid of E_MKSTEMP and E_FCHMOD.
[paraslash.git]
/
string.c
diff --git
a/string.c
b/string.c
index
a6019e3
..
f1f016f
100644
(file)
--- a/
string.c
+++ b/
string.c
@@
-260,20
+260,21
@@
__must_check __malloc char *para_tmpname(void)
* set the given mode of the tempfile if mkstemp() returned success.
*
* \return The file descriptor of the temp file just created on success.
* set the given mode of the tempfile if mkstemp() returned success.
*
* \return The file descriptor of the temp file just created on success.
- * On errors,
-E_MKSTEMP or -E_FCHMOD
is returned.
+ * On errors,
a negative value
is returned.
*/
__must_check int para_mkstemp(char *template, mode_t mode)
{
int tmp, fd = mkstemp(template);
if (fd < 0)
*/
__must_check int para_mkstemp(char *template, mode_t mode)
{
int tmp, fd = mkstemp(template);
if (fd < 0)
- return -E
_MKSTEMP
;
+ return -E
RRNO_TO_PARA_ERROR(errno)
;
tmp = fchmod(fd, mode);
if (tmp >= 0)
return fd;
tmp = fchmod(fd, mode);
if (tmp >= 0)
return fd;
+ tmp = errno;
close(fd);
unlink(template);
close(fd);
unlink(template);
- return -E
_FCHMOD
;
+ return -E
RRNO_TO_PARA_ERROR(tmp)
;
}
/**
}
/**