diff options
Diffstat (limited to 'contrib/groff/src/utils/indxbib')
-rw-r--r-- | contrib/groff/src/utils/indxbib/Makefile.sub | 6 | ||||
-rw-r--r-- | contrib/groff/src/utils/indxbib/indxbib.cc | 26 | ||||
-rw-r--r-- | contrib/groff/src/utils/indxbib/signal.c | 6 |
3 files changed, 15 insertions, 23 deletions
diff --git a/contrib/groff/src/utils/indxbib/Makefile.sub b/contrib/groff/src/utils/indxbib/Makefile.sub index f45a7a7..01e43b2 100644 --- a/contrib/groff/src/utils/indxbib/Makefile.sub +++ b/contrib/groff/src/utils/indxbib/Makefile.sub @@ -1,10 +1,10 @@ -PROG=indxbib +PROG=indxbib$(EXEEXT) MAN1=indxbib.n XLIBS=$(LIBBIB) $(LIBGROFF) MLIB=$(LIBM) OBJS=\ - indxbib.o \ - signal.o + indxbib.$(OBJEXT) \ + signal.$(OBJEXT) CCSRCS=\ $(srcdir)/indxbib.cc CSRCS=\ diff --git a/contrib/groff/src/utils/indxbib/indxbib.cc b/contrib/groff/src/utils/indxbib/indxbib.cc index 4b2477f..9fced93 100644 --- a/contrib/groff/src/utils/indxbib/indxbib.cc +++ b/contrib/groff/src/utils/indxbib/indxbib.cc @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989-1992, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1989-1992, 2000, 2001, 2002 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -18,14 +18,13 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdio.h> +#include "lib.h" + #include <stdlib.h> -#include <string.h> #include <assert.h> #include <errno.h> #include "posix.h" -#include "lib.h" #include "errarg.h" #include "error.h" #include "stringclass.h" @@ -39,12 +38,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern "C" const char *Version_string; -#ifndef HAVE_MKSTEMP_PROTO -extern "C" { - extern int mkstemp(char *); -} -#endif - #define DEFAULT_HASH_TABLE_SIZE 997 #define TEMP_INDEX_TEMPLATE "indxbibXXXXXX" @@ -229,7 +222,7 @@ int main(int argc, char **argv) name_max = file_name_max("."); const char *filename = p ? p + 1 : basename; if (name_max >= 0 && - long(strlen(filename) + sizeof(INDEX_SUFFIX) - 1) > name_max) + (strlen(filename) + sizeof(INDEX_SUFFIX) - 1) > name_max) fatal("`%1.%2' is too long for a filename", filename, INDEX_SUFFIX); if (p) { p++; @@ -240,16 +233,8 @@ int main(int argc, char **argv) else { temp_index_file = strsave(TEMP_INDEX_TEMPLATE); } -#ifndef HAVE_MKSTEMP - if (!mktemp(temp_index_file) || !temp_index_file[0]) - fatal("cannot create file name for temporary file"); -#endif catch_fatal_signals(); -#ifdef HAVE_MKSTEMP int fd = mkstemp(temp_index_file); -#else - int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH); -#endif if (fd < 0) fatal("can't create temporary index file: %1", strerror(errno)); indxfp = fdopen(fd, FOPEN_WB); @@ -300,6 +285,9 @@ int main(int argc, char **argv) strcpy(index_file, basename); strcat(index_file, INDEX_SUFFIX); #ifdef HAVE_RENAME +#ifdef __EMX__ + unline(index_file); +#endif /* __EMX__ */ if (rename(temp_index_file, index_file) < 0) { #ifdef __MSDOS__ // RENAME could fail on plain MSDOS filesystems because diff --git a/contrib/groff/src/utils/indxbib/signal.c b/contrib/groff/src/utils/indxbib/signal.c index 8078472..fccd289 100644 --- a/contrib/groff/src/utils/indxbib/signal.c +++ b/contrib/groff/src/utils/indxbib/signal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992 Free Software Foundation, Inc. +/* Copyright (C) 1992, 2001 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -20,6 +20,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Unfortunately vendors seem to have problems writing a <signal.h> that is correct for C++, so we implement all signal handling in C. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <sys/types.h> #include <signal.h> #ifdef HAVE_UNISTD_H |