diff options
author | peter <peter@FreeBSD.org> | 1995-12-10 22:31:58 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-12-10 22:31:58 +0000 |
commit | 9c0211c38d00915e1a7109af0ca88a4776e8ff28 (patch) | |
tree | ab8873521e726a9cbb3cccd0cf3207064d127764 /gnu/usr.bin/cvs/lib | |
parent | 54f5dbeb8084710baff05d886e507c3d7a6e3619 (diff) | |
parent | c3c3e9aba6d002529b8e3b6651ea485f81b879ad (diff) | |
download | FreeBSD-src-9c0211c38d00915e1a7109af0ca88a4776e8ff28.zip FreeBSD-src-9c0211c38d00915e1a7109af0ca88a4776e8ff28.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r12752,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'gnu/usr.bin/cvs/lib')
-rw-r--r-- | gnu/usr.bin/cvs/lib/config.h | 110 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/error.c | 87 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/getdate.y | 8 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/sighandle.c | 33 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/lib/wait.h | 3 |
5 files changed, 176 insertions, 65 deletions
diff --git a/gnu/usr.bin/cvs/lib/config.h b/gnu/usr.bin/cvs/lib/config.h index cd1b857..ce06c62 100644 --- a/gnu/usr.bin/cvs/lib/config.h +++ b/gnu/usr.bin/cvs/lib/config.h @@ -1,11 +1,20 @@ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* #undef _ALL_SOURCE */ +#endif + /* Define if using alloca.c. */ /* #undef C_ALLOCA */ /* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ /* #undef __CHAR_UNSIGNED__ */ +#endif /* Define to empty if the keyword does not work. */ /* #undef const */ @@ -17,21 +26,33 @@ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ +/* Define if you have alloca, as a function or macro. */ +#define HAVE_ALLOCA 1 + /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* #undef HAVE_ALLOCA_H */ /* Define if you support file names longer than 14 characters. */ #define HAVE_LONG_FILE_NAMES 1 +/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + /* Define if utime(file, NULL) sets file's timestamp to the present. */ #define HAVE_UTIME_NULL 1 +/* Define as __inline if that's what the C compiler calls it. */ +/* #undef inline */ + /* Define if on MINIX. */ /* #undef _MINIX */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef mode_t */ +/* Define to `int' if <sys/types.h> doesn't define. */ +/* #undef pid_t */ + /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ @@ -54,15 +75,43 @@ */ /* #undef STACK_DIRECTION */ +/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Define if your <sys/time.h> declares struct tm. */ -/* #undef TM_IN_SYS_TIME */ +/* Define if you can safely include both <sys/time.h> and <time.h>. */ +#define TIME_WITH_SYS_TIME 1 /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ +/* Define if you have MIT Kerberos version 4 available. */ +/* #undef HAVE_KERBEROS */ + +/* Define if you want CVS to be able to be a remote repository client. */ +#define CLIENT_SUPPORT 1 + +/* Define if you want CVS to be able to serve repositories to remote + clients. */ +#define SERVER_SUPPORT 1 + +/* the path to the gnu diff program on your system */ +#define DIFF "/usr/bin/diff -a" + +/* The number of bytes in a int. */ +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/* Define if you have the connect function. */ +/* #undef HAVE_CONNECT */ + +/* Define if you have the fchdir function. */ +#define HAVE_FCHDIR 1 + /* Define if you have the fchmod function. */ #define HAVE_FCHMOD 1 @@ -75,6 +124,12 @@ /* Define if you have the ftruncate function. */ #define HAVE_FTRUNCATE 1 +/* Define if you have the getpagesize function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define if you have the krb_get_err_text function. */ +/* #undef HAVE_KRB_GET_ERR_TEXT */ + /* Define if you have the mkfifo function. */ #define HAVE_MKFIFO 1 @@ -84,12 +139,33 @@ /* Define if you have the setvbuf function. */ #define HAVE_SETVBUF 1 +/* Define if you have the sigaction function. */ +#define HAVE_SIGACTION 1 + +/* Define if you have the sigblock function. */ +#define HAVE_SIGBLOCK 1 + +/* Define if you have the sigprocmask function. */ +#define HAVE_SIGPROCMASK 1 + +/* Define if you have the sigsetmask function. */ +#define HAVE_SIGSETMASK 1 + +/* Define if you have the sigvec function. */ +#define HAVE_SIGVEC 1 + +/* Define if you have the timezone function. */ +#define HAVE_TIMEZONE 1 + /* Define if you have the vfork function. */ #define HAVE_VFORK 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 +/* Define if you have the <direct.h> header file. */ +/* #undef HAVE_DIRECT_H */ + /* Define if you have the <dirent.h> header file. */ #define HAVE_DIRENT_H 1 @@ -99,6 +175,9 @@ /* Define if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 +/* Define if you have the <io.h> header file. */ +/* #undef HAVE_IO_H */ + /* Define if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 @@ -111,23 +190,44 @@ /* Define if you have the <string.h> header file. */ #define HAVE_STRING_H 1 +/* Define if you have the <sys/bsdtypes.h> header file. */ +/* #undef HAVE_SYS_BSDTYPES_H */ + /* Define if you have the <sys/dir.h> header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the <sys/ndir.h> header file. */ /* #undef HAVE_SYS_NDIR_H */ +/* Define if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 +/* Define if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + /* Define if you have the <sys/timeb.h> header file. */ #define HAVE_SYS_TIMEB_H 1 -/* Define if you have the <sys/wait.h> header file. */ -#define HAVE_SYS_WAIT_H 1 - /* Define if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define if you have the <utime.h> header file. */ #define HAVE_UTIME_H 1 + +/* Define if you have the inet library (-linet). */ +/* #undef HAVE_LIBINET */ + +/* Define if you have the nsl library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define if you have the nsl_s library (-lnsl_s). */ +/* #undef HAVE_LIBNSL_S */ + +/* Define if you have the socket library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ diff --git a/gnu/usr.bin/cvs/lib/error.c b/gnu/usr.bin/cvs/lib/error.c index 6734c02..0398103 100644 --- a/gnu/usr.bin/cvs/lib/error.c +++ b/gnu/usr.bin/cvs/lib/error.c @@ -18,26 +18,20 @@ /* David MacKenzie */ /* Brian Berliner added support for CVS */ +#include "cvs.h" + #ifndef lint -static char rcsid[] = "$CVSid: @(#)error.c 1.13 94/09/30 $"; +static const char rcsid[] = "$CVSid: @(#)error.c 1.13 94/09/30 $"; +USE(rcsid); #endif /* not lint */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <stdio.h> -/* turn on CVS support by default, since this is the CVS distribution */ -#define CVS_SUPPORT - -#ifdef CVS_SUPPORT -#if __STDC__ -void Lock_Cleanup(void); -#else -void Lock_Cleanup(); -#endif /* __STDC__ */ -#endif /* CVS_SUPPORT */ +/* If non-zero, error will use the CVS protocol to stdout to report error + messages. This will only be set in the CVS server parent process; + most other code is run via do_cvs_command, which forks off a child + process and packages up its stderr in the protocol. */ +int error_use_protocol; #ifdef HAVE_VPRINTF @@ -74,6 +68,20 @@ void exit (); extern char *strerror (); +typedef void (*fn_returning_void) (); + +/* Function to call before exiting. */ +static fn_returning_void cleanup_fn; + +fn_returning_void +error_set_cleanup (arg) + fn_returning_void arg; +{ + fn_returning_void retval = cleanup_fn; + cleanup_fn = arg; + return retval; +} + /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args. If ERRNUM is nonzero, print its corresponding system error message. @@ -81,60 +89,58 @@ extern char *strerror (); /* VARARGS */ void #if defined (HAVE_VPRINTF) && __STDC__ -error (int status, int errnum, char *message, ...) +error (int status, int errnum, const char *message, ...) #else error (status, errnum, message, va_alist) int status; int errnum; - char *message; + const char *message; va_dcl #endif { + FILE *out = stderr; extern char *program_name; -#ifdef CVS_SUPPORT extern char *command_name; -#endif #ifdef HAVE_VPRINTF va_list args; #endif -#ifdef CVS_SUPPORT + if (error_use_protocol) + { + out = stdout; + printf ("E "); + } + if (command_name && *command_name) if (status) - fprintf (stderr, "%s [%s aborted]: ", program_name, command_name); + fprintf (out, "%s [%s aborted]: ", program_name, command_name); else - fprintf (stderr, "%s %s: ", program_name, command_name); + fprintf (out, "%s %s: ", program_name, command_name); else - fprintf (stderr, "%s: ", program_name); -#else - fprintf (stderr, "%s: ", program_name); -#endif + fprintf (out, "%s: ", program_name); #ifdef HAVE_VPRINTF VA_START (args, message); - vfprintf (stderr, message, args); + vfprintf (out, message, args); va_end (args); #else #ifdef HAVE_DOPRNT - _doprnt (message, &args, stderr); + _doprnt (message, &args, out); #else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); + fprintf (out, message, a1, a2, a3, a4, a5, a6, a7, a8); #endif #endif if (errnum) - fprintf (stderr, ": %s", strerror (errnum)); - putc ('\n', stderr); - fflush (stderr); + fprintf (out, ": %s", strerror (errnum)); + putc ('\n', out); + fflush (out); if (status) { -#ifdef CVS_SUPPORT - Lock_Cleanup(); -#endif + if (cleanup_fn) + (*cleanup_fn) (); exit (status); } } -#ifdef CVS_SUPPORT - /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args to the file specified by FP. If ERRNUM is nonzero, print its corresponding system error message. @@ -175,11 +181,8 @@ fperror (fp, status, errnum, message, va_alist) fflush (fp); if (status) { -#ifdef CVS_SUPPORT - Lock_Cleanup(); -#endif + if (cleanup_fn) + (*cleanup_fn) (); exit (status); } } - -#endif /* CVS_SUPPORT */ diff --git a/gnu/usr.bin/cvs/lib/getdate.y b/gnu/usr.bin/cvs/lib/getdate.y index 5769e9c..baa1731 100644 --- a/gnu/usr.bin/cvs/lib/getdate.y +++ b/gnu/usr.bin/cvs/lib/getdate.y @@ -92,6 +92,14 @@ struct timeb { #define bcopy(from, to, len) memcpy ((to), (from), (len)) #endif +#if defined (STDC_HEADERS) +#include <stdlib.h> +#endif + +#if defined (HAVE_ALLOCA_H) +#include <alloca.h> +#endif + extern struct tm *gmtime(); extern struct tm *localtime(); diff --git a/gnu/usr.bin/cvs/lib/sighandle.c b/gnu/usr.bin/cvs/lib/sighandle.c index 1db4177..a225983 100644 --- a/gnu/usr.bin/cvs/lib/sighandle.c +++ b/gnu/usr.bin/cvs/lib/sighandle.c @@ -37,6 +37,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "system.h" #include <sys/types.h> #include <stdio.h> @@ -54,10 +55,6 @@ char *malloc(); #endif /* __STDC__ */ #endif /* STDC_HEADERS */ -#ifdef _MINIX -#undef POSIX /* Minix 1.6 doesn't support POSIX.1 sigaction yet */ -#endif - /* Define the highest signal number (usually) */ #ifndef SIGMAX #define SIGMAX 64 @@ -78,7 +75,7 @@ static struct SIG_hlist **SIG_handlers; /* Define array of default signal vectors */ -#ifdef POSIX +#ifdef POSIX_SIGNALS static struct sigaction *SIG_defaults; #else #ifdef BSD_SIGNALS @@ -90,7 +87,7 @@ static RETSIGTYPE (**SIG_defaults)(); /* Critical section housekeeping */ static int SIG_crSectNest = 0; /* Nesting level */ -#ifdef POSIX +#ifdef POSIX_SIGNALS static sigset_t SIG_crSectMask; /* Signal mask */ #else static int SIG_crSectMask; /* Signal mask */ @@ -103,14 +100,14 @@ static int SIG_crSectMask; /* Signal mask */ static int SIG_init() { int i; -#ifdef POSIX +#ifdef POSIX_SIGNALS sigset_t sigset_test; #endif if (SIG_defaults && SIG_handlers) /* already allocated */ return (0); -#ifdef POSIX +#ifdef POSIX_SIGNALS (void) sigfillset(&sigset_test); for (i = 1; i < SIGMAX && sigismember(&sigset_test, i) == 1; i++) ; @@ -175,7 +172,7 @@ RETSIGTYPE (*fn)(); { int val; struct SIG_hlist *this; -#ifdef POSIX +#ifdef POSIX_SIGNALS struct sigaction act; sigset_t sigset_mask, sigset_omask; #else @@ -191,7 +188,7 @@ RETSIGTYPE (*fn)(); val = 0; /* Block this signal while we look at handler chain */ -#ifdef POSIX +#ifdef POSIX_SIGNALS (void) sigemptyset(&sigset_mask); (void) sigaddset(&sigset_mask, sig); (void) sigprocmask(SIG_BLOCK, &sigset_mask, &sigset_omask); @@ -220,7 +217,7 @@ RETSIGTYPE (*fn)(); if (SIG_handlers[sig] == (struct SIG_hlist *) NULL) { -#ifdef POSIX +#ifdef POSIX_SIGNALS act.sa_handler = SIG_handle; (void) sigemptyset(&act.sa_mask); act.sa_flags = 0; @@ -257,7 +254,7 @@ RETSIGTYPE (*fn)(); } /* Unblock the signal */ -#ifdef POSIX +#ifdef POSIX_SIGNALS (void) sigprocmask(SIG_SETMASK, &sigset_omask, NULL); #else #ifdef BSD_SIGNALS @@ -280,7 +277,7 @@ RETSIGTYPE (*fn)(); int val; struct SIG_hlist *this; struct SIG_hlist *last; -#ifdef POSIX +#ifdef POSIX_SIGNALS sigset_t sigset_mask, sigset_omask; #else #ifdef BSD_SIGNALS @@ -295,7 +292,7 @@ RETSIGTYPE (*fn)(); last = (struct SIG_hlist *) NULL; /* Block this signal while we look at handler chain */ -#ifdef POSIX +#ifdef POSIX_SIGNALS (void) sigemptyset(&sigset_mask); (void) sigaddset(&sigset_mask, sig); (void) sigprocmask(SIG_BLOCK, &sigset_mask, &sigset_omask); @@ -330,7 +327,7 @@ RETSIGTYPE (*fn)(); /* Restore default behavior if there are no registered handlers */ if (SIG_handlers[sig] == (struct SIG_hlist *) NULL) { -#ifdef POSIX +#ifdef POSIX_SIGNALS val = sigaction(sig, &SIG_defaults[sig], (struct sigaction *) NULL); #else @@ -344,7 +341,7 @@ RETSIGTYPE (*fn)(); } /* Unblock the signal */ -#ifdef POSIX +#ifdef POSIX_SIGNALS (void) sigprocmask(SIG_SETMASK, &sigset_omask, NULL); #else #ifdef BSD_SIGNALS @@ -365,7 +362,7 @@ void SIG_beginCrSect() { if (SIG_crSectNest == 0) { -#ifdef POSIX +#ifdef POSIX_SIGNALS sigset_t sigset_mask; (void) sigfillset(&sigset_mask); @@ -394,7 +391,7 @@ void SIG_endCrSect() SIG_crSectNest--; if (SIG_crSectNest == 0) { -#ifdef POSIX +#ifdef POSIX_SIGNALS (void) sigprocmask(SIG_SETMASK, &SIG_crSectMask, NULL); #else #ifdef BSD_SIGNALS diff --git a/gnu/usr.bin/cvs/lib/wait.h b/gnu/usr.bin/cvs/lib/wait.h index 2e47773..db60434 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) |