X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=string.c;h=bd53e8d24462d1bbde5045f7b0b80de939460588;hp=51461b20938df75ed79211b9b5bc5e97e46333e0;hb=df743de3c09a9f02c95bd3ff50e19a401b957efe;hpb=29be20dfd84779aeebfc3e1418cb4796e7b91dd6 diff --git a/string.c b/string.c index 51461b20..bd53e8d2 100644 --- a/string.c +++ b/string.c @@ -91,7 +91,7 @@ __must_check __malloc void *para_calloc(size_t size) } /** - * Pparaslash's version of strdup(). + * Paraslash's version of strdup(). * * \param s The string to be duplicated. * @@ -250,33 +250,6 @@ __must_check __malloc char *para_tmpname(void) return make_message("%08i", rand()); } -/** - * Create unique temporary file. - * - * \param template The template to be passed to mkstemp(). - * \param mode The desired mode of the tempfile. - * - * This wrapper for mkstemp additionally uses fchmod() to - * 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, a negative value is returned. - */ -__must_check int para_mkstemp(char *template, mode_t mode) -{ - int tmp, fd = mkstemp(template); - - if (fd < 0) - return -ERRNO_TO_PARA_ERROR(errno); - tmp = fchmod(fd, mode); - if (tmp >= 0) - return fd; - tmp = errno; - close(fd); - unlink(template); - return -ERRNO_TO_PARA_ERROR(tmp); -} - /** * Get the logname of the current user. *