summaryrefslogtreecommitdiff
path: root/src/libs/libgroff/tmpfile.cc
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-07-20 14:36:50 +0000
committerwlemb <wlemb>2001-07-20 14:36:50 +0000
commit0c2857af24a536366560a8a13c64fd6ea25f8408 (patch)
tree581239e098ec25f99e3939b5eca17f5054061dbc /src/libs/libgroff/tmpfile.cc
parent8ec25476b88dc3138d74c285cf249a90200ae6ac (diff)
downloadgroff-0c2857af24a536366560a8a13c64fd6ea25f8408.tar.gz
* src/libs/libgroff/tmpname.cc: New file, defining get_tempname().
* src/libs/libgroff/mkstemp.cc: New file. * src/libs/libgroff/mksdir.cc: New file. * src/libs/libgroff/tmpfile.cc [HAVE_MKSTEMP_PROTO]: Removed. (xtmpfile) [!HAVE_MKSTEMP]: Removed. * src/libs/libgroff/Makefile.sub: Updated. * src/include/lib.h: Add mksdir() prototype. * src/include/posix.h: Define S_IXUSR if not yet defined. * src/preproc/html/pre-html.cc (MAX_RETRIES): Removed. (createAllPages): Use mksdir() instead of current code. * src/utils/indxbib/indxbib.cc [HAVE_MKSTEMP_PROTO]: Removed. (main): [!HAVE_MKSTEMP]: Removed. * aclocal.m4 (GROFF_MKSTEMP): Updated to use new mkstemp.cc file. (GROFF_INTTYPES_H, GROFF_UNSIGNED_LONG_LONG, GROFF_UINTMAX_T): New macros. * configure.ac: Add tests for stdint.h, sys/time.h, and gettimeofday(). Call new GROFF_xxx macros. * configure: Regenerated. * Makefile.in: Comments updated.
Diffstat (limited to 'src/libs/libgroff/tmpfile.cc')
-rw-r--r--src/libs/libgroff/tmpfile.cc16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/libs/libgroff/tmpfile.cc b/src/libs/libgroff/tmpfile.cc
index 4a53a06b..fdce09ee 100644
--- a/src/libs/libgroff/tmpfile.cc
+++ b/src/libs/libgroff/tmpfile.cc
@@ -30,12 +30,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "error.h"
#include "nonposix.h"
-#ifndef HAVE_MKSTEMP_PROTO
-extern "C" {
- extern int mkstemp (char *);
-}
-#endif
-
// If this is set, create temporary files there
#define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR"
// otherwise if this is set, create temporary files there
@@ -161,8 +155,6 @@ FILE *xtmpfile(char **namep,
int do_unlink)
{
char *templ = xtmptemplate(postfix_long, postfix_short);
-
-#ifdef HAVE_MKSTEMP
errno = 0;
int fd = mkstemp(templ);
if (fd < 0)
@@ -171,14 +163,6 @@ FILE *xtmpfile(char **namep,
FILE *fp = fdopen(fd, FOPEN_RWB); // many callers of xtmpfile use binary I/O
if (!fp)
fatal("fdopen: %1", strerror(errno));
-#else /* not HAVE_MKSTEMP */
- if (!mktemp(templ) || !templ[0])
- fatal("cannot create file name for temporary file");
- errno = 0;
- FILE *fp = fopen(templ, FOPEN_RWB);
- if (!fp)
- fatal("cannot open `%1': %2", templ, strerror(errno));
-#endif /* not HAVE_MKSTEMP */
if (do_unlink)
add_tmp_file(templ);
if (namep)