summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/lib
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-01-30 00:19:41 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-01-30 00:19:41 +0000
commitde069631fd3bce2e513ee8613a94038f23afe1b3 (patch)
tree0b8d9d99cdfb52e8d0c3f85c45859a42ed004bd3 /gnu/usr.bin/cvs/lib
parent2b9936f3f7ab47a89436d4fa3b70e4c09dd2398e (diff)
Upgrade to 1.7.1 snapshot
Diffstat (limited to 'gnu/usr.bin/cvs/lib')
-rw-r--r--gnu/usr.bin/cvs/lib/.cvsignore2
-rw-r--r--gnu/usr.bin/cvs/lib/ChangeLog147
-rw-r--r--gnu/usr.bin/cvs/lib/fnmatch.c10
-rw-r--r--gnu/usr.bin/cvs/lib/getline.c126
-rw-r--r--gnu/usr.bin/cvs/lib/getline.h15
-rw-r--r--gnu/usr.bin/cvs/lib/mkdir.c2
-rw-r--r--gnu/usr.bin/cvs/lib/rename.c4
-rw-r--r--gnu/usr.bin/cvs/lib/system.h167
-rw-r--r--gnu/usr.bin/cvs/lib/valloc.c12
-rw-r--r--gnu/usr.bin/cvs/lib/wait.h3
-rw-r--r--gnu/usr.bin/cvs/lib/yesno.c1
11 files changed, 442 insertions, 47 deletions
diff --git a/gnu/usr.bin/cvs/lib/.cvsignore b/gnu/usr.bin/cvs/lib/.cvsignore
new file mode 100644
index 00000000000..3ad620cb65e
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+.pure
diff --git a/gnu/usr.bin/cvs/lib/ChangeLog b/gnu/usr.bin/cvs/lib/ChangeLog
index 0494e1bfefa..ce886e0cea7 100644
--- a/gnu/usr.bin/cvs/lib/ChangeLog
+++ b/gnu/usr.bin/cvs/lib/ChangeLog
@@ -1,3 +1,146 @@
+Thu Jan 25 00:14:06 1996 Jim Kingdon <kingdon@beezley.cyclic.com>
+
+ * yesno.c (yesno): fflush stdout as well as stderr.
+
+Wed Jan 3 18:16:50 1996 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sighandle.c (SIG_register): Use memset not bzero.
+ * system.h: Remove defines for index, rindex, bcmp, and bzero.
+ All the calls to those functions are gone from CVS.
+
+Tue Jan 2 13:00:00 1996 Jim Kingdon <kingdon@peary.cyclic.com>
+
+ Visual C++ lint:
+ * sighandle.c: Prototype SIG_handle and SIG_defaults.
+ Use SIG_ERR where appropriate.
+
+Mon Dec 18 10:15:05 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * rename.c: Check ENOENT rather than existence_error. The latter
+ is undefined in this file, and including system.h is said to cause
+ (unspecified) problems.
+
+Sun Dec 17 23:58:06 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * vasprintf.c: Removed (it is no longer used).
+ * Makefile.in (SOURCES): Remove vasprintf.c.
+
+Sat Dec 16 17:18:33 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * vasprintf.c: Added.
+ * Makefile.in (SOURCES): Add vasprintf.c
+
+Mon Dec 4 10:54:04 1995 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * getdate.c: Remove #line directives. I know, this is a kludge,
+ but Visual C++ 2.1 seems to require it (why, I have no idea. It
+ has no trouble with the #line directives in getdate in CVS 1.6).
+
+Sat Nov 18 16:20:37 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * rename.c: same.
+
+ * mkdir.c: Use new macro `existence_error', instead of comparing
+ errno to ENOENT directly.
+
+ * system.h (existence_error): new macro, tries to portably ask if
+ errno represents a file-not-exist error.
+
+Fri Nov 17 20:08:58 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * system.h (NEED_DECOY_PERMISSIONS): moved this section to where
+ it belongs, duh.
+
+ * getdate.c: if STDC_HEADERS, then just include <stdlib.h> instead
+ of declaring malloc() and realloc() to be char *.
+
+ * system.h: ifdef NEED_DECOY_PERMISSIONS, then define the S_I*
+ permission masks for USR, GRP, and OTH in terms of the simpler
+ OS/2 masks.
+
+Wed Nov 15 15:36:03 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * system.h: ifdef USE_OWN_TCPIP_H, then include "tcpip.h". Only
+ OS/2 does this right now.
+
+Tue Nov 14 18:44:57 1995 Greg A. Woods <woods@most.weird.com>
+
+ * getdate.c: OK, this one is from SunOS-4.1 yacc and may be more
+ portable -- at least it compiles silently here! ;-)
+
+Mon Nov 13 03:53:45 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * fnmatch.c: conform to 80 column standard (yes, I'm a pedant).
+
+Wed Nov 8 11:10:59 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * system.h (STAT_MACROS): ifdef S_IFMT, then use it as before; but
+ if it's not defined, then just do a single mask and assume
+ acceptance any of non-zero result. Norbert, I trust you'll let me
+ know if this is unsatisfactory. :-)
+ Ifdef HAVE_SYS_UTIME_H, then include <sys/utime.h>. Only OS/2
+ defines this right now.
+
+Wed Nov 8 13:18:51 1995 Norbert Kiesel <nk@col.sw-ley.de>
+
+ * valloc.c: omit malloc declaration (it's already in system.h
+ which is included and conflicts with <stdlib.h> on some
+ systems).
+
+Tue Nov 7 19:38:48 1995 Norbert Kiesel <nk@col.sw-ley.de>
+
+ * system.h (STAT_MACROS_BROKEN): undo previous change, because
+ else all regular files will be identified as links (the mask for
+ links is S_IFREG|S_IFCHR).
+
+Mon Nov 6 19:20:56 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * system.h (STAT_MACROS_BROKEN): in defining the S_IF* macros,
+ don't fold to 1 or 0 by first masking with S_IFMT; not all
+ systems have that macro, and anyway it's only necessary that we
+ return non-zero.
+
+Fri Oct 27 13:43:35 1995 Karl Fogel <kfogel@floss.cyclic.com>
+
+ * save-cwd.c: use __PROTO instead of __P (see below).
+
+ * getline.h (__PROTO): same as below.
+
+ * save-cwd.h (__PROTO): replaces __P. New name, so don't ask if
+ already defined. The conflict was that OS/2 w/ IBM C/C++ uses
+ `__P' for something else, in <ctype.h> of all places.
+
+ * system.h: do nothing about alloca ifdef ALLOCA_IN_STDLIB (see
+ ../src/ChangeLog).
+
+Tue Oct 24 13:01:25 1995 Norbert Kiesel <nk@col.sw-ley.de>
+
+ * wait.h: include sys/resource.h if available. This is needed at
+ least under AIX-3.2 where <sys/wait.h> doesn't include it.
+
+Mon Oct 23 17:39:11 1995 Norbert Kiesel <nk@col.sw-ley.de>
+
+ * valloc.c (valloc): change parameter definition
+
+Sun Oct 22 14:15:44 1995 Jim Meyering (meyering@comco.com)
+
+ * getline.c, getline.h: New files.
+ * Makefile.in (SOURCES, OBJECTS, HEADERS): Add getline.c, getline.o,
+ and getline.h, respectively.
+
+Tue Oct 10 18:01:50 1995 Karl Fogel <kfogel@totoro.cyclic.com>
+
+ * Makefile.in (cvs_srcdir): define cvs_srcdir to be ../src, then
+ include it with -I so save_cwd.c can find error.h (for example).
+
+Sun Oct 8 12:27:57 1995 Peter Wemm <peter@haywire.DIALix.COM>
+
+ * system.h: define POSIX_SIGNALS or BSD_SIGNALS if configure has
+ located all the necessary functions for each "type".
+ * sighandle.c: detect/use POSIX/BSD reliable signals (especially
+ for blocking signals in critical sections). Helps prevent stray
+ locks on interruption.
+
Mon Oct 2 18:11:23 1995 Jim Blandy <jimb@totoro.cyclic.com>
* system.h: Doc fix.
@@ -19,9 +162,9 @@ Sun Oct 1 21:03:40 1995 Karl Fogel <kfogel@totoro.cyclic.com>
* regex.c: reverted below change.
Thu Sep 28 13:37:04 1995 Larry Jones <larry.jones@sdrc.com>
-
+
* regexp.c: check for ISC.
-
+
Thu Sep 7 19:18:00 1995 Jim Blandy <jimb@cyclic.com>
* save-cwd.c: #include <direct.h> and <io.h>, on systems that
diff --git a/gnu/usr.bin/cvs/lib/fnmatch.c b/gnu/usr.bin/cvs/lib/fnmatch.c
index ff17ab0de16..9cb847e8b1d 100644
--- a/gnu/usr.bin/cvs/lib/fnmatch.c
+++ b/gnu/usr.bin/cvs/lib/fnmatch.c
@@ -23,11 +23,11 @@ Cambridge, MA 02139, USA. */
#include "config.h"
#endif
-/* Some file systems are case-insensitive. If FOLD_FN_CHAR is #defined, it maps
- the character C onto its "canonical" form. In a case-insensitive system,
- it would map all alphanumeric characters to lower case. Under Windows NT,
- / and \ are both path component separators, so FOLD_FN_CHAR would map them both
- to /. */
+/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
+ #defined, it maps the character C onto its "canonical" form. In a
+ case-insensitive system, it would map all alphanumeric characters
+ to lower case. Under Windows NT, / and \ are both path component
+ separators, so FOLD_FN_CHAR would map them both to /. */
#ifndef FOLD_FN_CHAR
#define FOLD_FN_CHAR(c) (c)
#endif
diff --git a/gnu/usr.bin/cvs/lib/getline.c b/gnu/usr.bin/cvs/lib/getline.c
new file mode 100644
index 00000000000..c69946148f6
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/getline.c
@@ -0,0 +1,126 @@
+/* getline.c -- Replacement for GNU C library function getline
+
+Copyright (C) 1993 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <stdio.h>
+#define NDEBUG
+#include <assert.h>
+
+#if STDC_HEADERS
+#include <stdlib.h>
+#else
+char *malloc (), *realloc ();
+#endif
+
+/* Always add at least this many bytes when extending the buffer. */
+#define MIN_CHUNK 64
+
+/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
+ + OFFSET (and null-terminate it). *LINEPTR is a pointer returned from
+ malloc (or NULL), pointing to *N characters of space. It is realloc'd
+ as necessary. Return the number of characters read (not including the
+ null terminator), or -1 on error or EOF. */
+
+int
+getstr (lineptr, n, stream, terminator, offset)
+ char **lineptr;
+ size_t *n;
+ FILE *stream;
+ char terminator;
+ int offset;
+{
+ int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
+ char *read_pos; /* Where we're reading into *LINEPTR. */
+ int ret;
+
+ if (!lineptr || !n || !stream)
+ return -1;
+
+ if (!*lineptr)
+ {
+ *n = MIN_CHUNK;
+ *lineptr = malloc (*n);
+ if (!*lineptr)
+ return -1;
+ }
+
+ nchars_avail = *n - offset;
+ read_pos = *lineptr + offset;
+
+ for (;;)
+ {
+ register int c = getc (stream);
+
+ /* We always want at least one char left in the buffer, since we
+ always (unless we get an error while reading the first char)
+ NUL-terminate the line buffer. */
+
+ assert(*n - nchars_avail == read_pos - *lineptr);
+ if (nchars_avail < 2)
+ {
+ if (*n > MIN_CHUNK)
+ *n *= 2;
+ else
+ *n += MIN_CHUNK;
+
+ nchars_avail = *n + *lineptr - read_pos;
+ *lineptr = realloc (*lineptr, *n);
+ if (!*lineptr)
+ return -1;
+ read_pos = *n - nchars_avail + *lineptr;
+ assert(*n - nchars_avail == read_pos - *lineptr);
+ }
+
+ if (c == EOF || ferror (stream))
+ {
+ /* Return partial line, if any. */
+ if (read_pos == *lineptr)
+ return -1;
+ else
+ break;
+ }
+
+ *read_pos++ = c;
+ nchars_avail--;
+
+ if (c == terminator)
+ /* Return the line. */
+ break;
+ }
+
+ /* Done - NUL terminate and return the number of chars read. */
+ *read_pos = '\0';
+
+ ret = read_pos - (*lineptr + offset);
+ return ret;
+}
+
+int
+getline (lineptr, n, stream)
+ char **lineptr;
+ size_t *n;
+ FILE *stream;
+{
+ return getstr (lineptr, n, stream, '\n', 0);
+}
diff --git a/gnu/usr.bin/cvs/lib/getline.h b/gnu/usr.bin/cvs/lib/getline.h
new file mode 100644
index 00000000000..30bcc258373
--- /dev/null
+++ b/gnu/usr.bin/cvs/lib/getline.h
@@ -0,0 +1,15 @@
+#ifndef _getline_h_
+#define _getline_h_ 1
+
+#include <stdio.h>
+
+#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
+#define __PROTO(args) args
+#else
+#define __PROTO(args) ()
+#endif /* GCC. */
+
+int
+ getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream));
+
+#endif /* _getline_h_ */
diff --git a/gnu/usr.bin/cvs/lib/mkdir.c b/gnu/usr.bin/cvs/lib/mkdir.c
index a70c1d86619..89ed4b6c6f0 100644
--- a/gnu/usr.bin/cvs/lib/mkdir.c
+++ b/gnu/usr.bin/cvs/lib/mkdir.c
@@ -54,7 +54,7 @@ mkdir (dpath, dmode)
}
/* If stat fails for a reason other than non-existence, return error. */
- if (errno != ENOENT)
+ if (! existence_error (errno))
return -1;
cpid = fork ();
diff --git a/gnu/usr.bin/cvs/lib/rename.c b/gnu/usr.bin/cvs/lib/rename.c
index a36713b1687..ce2805b3a04 100644
--- a/gnu/usr.bin/cvs/lib/rename.c
+++ b/gnu/usr.bin/cvs/lib/rename.c
@@ -39,6 +39,8 @@ rename (from, to)
if (stat (from, &from_stats) == 0)
{
+ /* We don't check existence_error because the systems which need it
+ have rename(). */
if (unlink (to) && errno != ENOENT)
return -1;
if ((from_stats.st_mode & S_IFMT) == S_IFDIR)
@@ -72,6 +74,8 @@ rename (from, to)
}
else
{
+ /* We don't check existence_error because the systems which need it
+ have rename(). */
if (link (from, to) == 0 && (unlink (from) == 0 || errno == ENOENT))
return 0;
}
diff --git a/gnu/usr.bin/cvs/lib/system.h b/gnu/usr.bin/cvs/lib/system.h
index aafef3e618d..75023aef7dd 100644
--- a/gnu/usr.bin/cvs/lib/system.h
+++ b/gnu/usr.bin/cvs/lib/system.h
@@ -29,7 +29,11 @@
/* AIX alloca decl has to be the first thing in the file, bletch! */
#pragma alloca
#else /* not _AIX */
+#ifdef ALLOCA_IN_STDLIB
+ /* then we need do nothing */
+#else
char *alloca ();
+#endif /* not ALLOCA_IN_STDLIB */
#endif /* not _AIX */
#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUS__ */
@@ -50,38 +54,104 @@ char *alloca ();
#undef S_ISNWK
#endif
+/* Not all systems have S_IFMT, but we probably want to use it if we
+ do. See ChangeLog for a more detailed discussion. */
+
#if !defined(S_ISBLK) && defined(S_IFBLK)
-#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# if defined(S_IFMT)
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# else
+# define S_ISBLK(m) ((m) & S_IFBLK)
+# endif
#endif
+
#if !defined(S_ISCHR) && defined(S_IFCHR)
-#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# if defined(S_IFMT)
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# else
+# define S_ISCHR(m) ((m) & S_IFCHR)
+# endif
#endif
+
#if !defined(S_ISDIR) && defined(S_IFDIR)
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# if defined(S_IFMT)
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# else
+# define S_ISDIR(m) ((m) & S_IFDIR)
+# endif
#endif
+
#if !defined(S_ISREG) && defined(S_IFREG)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# if defined(S_IFMT)
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# else
+# define S_ISREG(m) ((m) & S_IFREG)
+# endif
#endif
+
#if !defined(S_ISFIFO) && defined(S_IFIFO)
-#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# if defined(S_IFMT)
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# else
+# define S_ISFIFO(m) ((m) & S_IFIFO)
+# endif
#endif
+
#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# if defined(S_IFMT)
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# else
+# define S_ISLNK(m) ((m) & S_IFLNK)
+# endif
#endif
+
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
-#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# if defined(S_IFMT)
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+# define S_ISSOCK(m) ((m) & S_IFSOCK)
+# endif
#endif
+
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
-#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
-#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+# if defined(S_IFMT)
+# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
+# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+# else
+# define S_ISMPB(m) ((m) & S_IFMPB)
+# define S_ISMPC(m) ((m) & S_IFMPC)
+# endif
#endif
+
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
-#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+# if defined(S_IFMT)
+# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+# else
+# define S_ISNWK(m) ((m) & S_IFNWK)
+# endif
#endif
+
#if !defined(HAVE_MKFIFO)
#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
#endif
+#ifdef NEED_DECOY_PERMISSIONS /* OS/2, really */
+
+#define S_IRUSR S_IREAD
+#define S_IWUSR S_IWRITE
+#define S_IXUSR S_IEXEC
+#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
+#define S_IRGRP S_IREAD
+#define S_IWGRP S_IWRITE
+#define S_IXGRP S_IEXEC
+#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#define S_IROTH S_IREAD
+#define S_IWOTH S_IWRITE
+#define S_IXOTH S_IEXEC
+#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+
+#else /* ! NEED_DECOY_PERMISSIONS */
+
#ifndef S_IRUSR
#define S_IRUSR 0400
#define S_IWUSR 0200
@@ -100,7 +170,8 @@ char *alloca ();
#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
/* Read, write, and execute by others. */
#define S_IRWXO (S_IRWXG >> 3)
-#endif
+#endif /* !def S_IRUSR */
+#endif /* NEED_DECOY_PERMISSIONS */
#if defined(POSIX) || defined(HAVE_UNISTD_H)
#include <unistd.h>
@@ -221,6 +292,8 @@ extern long timezone;
have to debug the configure check across all the machines). */
#if defined (HAVE_UTIME_H) && !defined (NeXT)
#include <utime.h>
+#elif defined (HAVE_SYS_UTIME_H)
+# include <sys/utime.h>
#else
#ifndef ALTOS
struct utimbuf
@@ -233,34 +306,36 @@ int utime ();
#endif
#if STDC_HEADERS || HAVE_STRING_H
-#include <string.h>
-/* An ANSI string.h and pre-ANSI memory.h might conflict. */
-#if !STDC_HEADERS && HAVE_MEMORY_H
-#include <memory.h>
-#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
-
-#ifndef index
-#define index strchr
-#endif /* index */
+# include <string.h>
+ /* An ANSI string.h and pre-ANSI memory.h might conflict. */
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+#else /* not STDC_HEADERS and not HAVE_STRING_H */
+# include <strings.h>
+ /* memory.h and strings.h conflict on some systems. */
+#endif /* not STDC_HEADERS and not HAVE_STRING_H */
-#ifndef rindex
-#define rindex strrchr
-#endif /* rindex */
+#include <errno.h>
-#ifndef bcmp
-#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
-#endif /* bcmp */
+/* Not all systems set the same error code on a non-existent-file
+ error. This tries to ask the question somewhat portably.
+ On systems that don't have ENOTEXIST, this should behave just like
+ x == ENOENT. "x" is probably errno, of course. */
-#ifndef bzero
-#define bzero(s, n) memset ((s), 0, (n))
-#endif /* bzero */
+#ifdef ENOTEXIST
+# ifdef EOS2ERR
+# define existence_error(x) \
+ (((x) == ENOTEXIST) || ((x) == ENOENT) || ((x) == EOS2ERR))
+# else
+# define existence_error(x) \
+ (((x) == ENOTEXIST) || ((x) == ENOENT))
+# endif
+#else
+# define existence_error(x) ((x) == ENOENT)
+#endif
-#else /* not STDC_HEADERS and not HAVE_STRING_H */
-#include <strings.h>
-/* memory.h and strings.h conflict on some systems. */
-#endif /* not STDC_HEADERS and not HAVE_STRING_H */
-#include <errno.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#else
@@ -277,6 +352,29 @@ char *getcwd ();
char *getwd ();
#endif
+/* check for POSIX signals */
+#if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK)
+# define POSIX_SIGNALS
+#endif
+
+/* MINIX 1.6 doesn't properly support sigaction */
+#if defined(_MINIX)
+# undef POSIX_SIGNALS
+#endif
+
+/* If !POSIX, try for BSD.. Reason: 4.4BSD implements these as wrappers */
+#if !defined(POSIX_SIGNALS)
+# if defined(HAVE_SIGVEC) && defined(HAVE_SIGSETMASK) && defined(HAVE_SIGBLOCK)
+# define BSD_SIGNALS
+# endif
+#endif
+
+/* Under OS/2, this must be included _after_ stdio.h; that's why we do
+ it here. */
+#ifdef USE_OWN_TCPIP_H
+#include "tcpip.h"
+#endif
+
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else
@@ -335,7 +433,6 @@ char *getwd ();
#define S_IWOTH 0000002 /* write permission, other */
#endif
-
/* Under MS-DOS and its derivatives (like Windows NT), mkdir takes only one
argument; permission is handled very differently on those systems than in
in Unix. So we leave such systems a hook on which they can hang their
diff --git a/gnu/usr.bin/cvs/lib/valloc.c b/gnu/usr.bin/cvs/lib/valloc.c
index ce37da7ad3a..674b60f6e91 100644
--- a/gnu/usr.bin/cvs/lib/valloc.c
+++ b/gnu/usr.bin/cvs/lib/valloc.c
@@ -1,14 +1,18 @@
/* valloc -- return memory aligned to the page size. */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "system.h"
+
#ifndef HAVE_GETPAGESIZE
#define getpagesize() 4096
#endif
-extern char *malloc ();
-
-char *
+void *
valloc (bytes)
- int bytes;
+ size_t bytes;
{
long pagesize;
char *ret;
diff --git a/gnu/usr.bin/cvs/lib/wait.h b/gnu/usr.bin/cvs/lib/wait.h
index 2e477730f54..db60434144a 100644
--- a/gnu/usr.bin/cvs/lib/wait.h
+++ b/gnu/usr.bin/cvs/lib/wait.h
@@ -17,6 +17,9 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/types.h> /* For pid_t. */
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h> /* for rusage */
+#endif
#include <sys/wait.h>
#else
#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
diff --git a/gnu/usr.bin/cvs/lib/yesno.c b/gnu/usr.bin/cvs/lib/yesno.c
index 7014803f480..86b0798086f 100644
--- a/gnu/usr.bin/cvs/lib/yesno.c
+++ b/gnu/usr.bin/cvs/lib/yesno.c
@@ -32,6 +32,7 @@ yesno ()
int rv;
fflush (stderr);
+ fflush (stdout);
c = getchar ();
rv = (c == 'y') || (c == 'Y');
while (c != EOF && c != '\n')