X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=string.c;h=f1f016f331bd81201f3534ecbb02041acd9919ba;hp=a6019e30cee2d71f0825e4eae2970b7209d9d74e;hb=ad8d5396323fb6c54527c5cd00a6fe39920678ed;hpb=d9de75ccdc85fd9bf90c6eb9a1b42dfdd84afd32;ds=sidebyside diff --git a/string.c b/string.c index a6019e30..f1f016f3 100644 --- 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. - * 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) - return -E_MKSTEMP; + return -ERRNO_TO_PARA_ERROR(errno); tmp = fchmod(fd, mode); if (tmp >= 0) return fd; + tmp = errno; close(fd); unlink(template); - return -E_FCHMOD; + return -ERRNO_TO_PARA_ERROR(tmp); } /**