diff options
| author | Ezra Peisach <epeisach@mit.edu> | 1996-01-11 16:33:11 +0000 |
|---|---|---|
| committer | Ezra Peisach <epeisach@mit.edu> | 1996-01-11 16:33:11 +0000 |
| commit | f06aecfc1c653435fa3a999080100ec0e9c6072c (patch) | |
| tree | 4f7f3c3661fc364b3e0ca8db7971e0fe765511a8 /src | |
| parent | 125f7eb168f5f385badaed99152822e7e3f4d803 (diff) | |
| download | krb5-f06aecfc1c653435fa3a999080100ec0e9c6072c.tar.gz krb5-f06aecfc1c653435fa3a999080100ec0e9c6072c.tar.xz krb5-f06aecfc1c653435fa3a999080100ec0e9c6072c.zip | |
* krcp.c (error): Convert to use varargs
* configure.in: Check for stdarg.h
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7308 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/appl/bsd/ChangeLog | 6 | ||||
| -rw-r--r-- | src/appl/bsd/configure.in | 4 | ||||
| -rw-r--r-- | src/appl/bsd/krcp.c | 34 |
3 files changed, 37 insertions, 7 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index f05c9a983..f6ab0efe1 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 11 11:27:04 1996 Ezra Peisach <epeisach@kangaroo.mit.edu> + + * krcp.c (error): Convert to use varargs. + + * configure.in: Check for stdarg.h + Wed Jan 10 21:26:20 1996 Theodore Y. Ts'o <tytso@dcl> * kcmd.c (getport): Clear the sin structure to be zero. (From diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index b6114736e..114d29547 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -52,7 +52,9 @@ AC_FUNC_CHECK(grantpt,AC_DEFINE(HAVE_GRANTPT)) AC_FUNC_CHECK(openpty,AC_DEFINE(HAVE_OPENPTY)) AC_FUNC_CHECK(setlogin,AC_DEFINE(HAVE_SETLOGIN)) AC_FUNC_CHECK(logwtmp,AC_DEFINE(HAVE_LOGWTMP)) -AC_CHECK_HEADERS(unistd.h stdlib.h string.h sys/filio.h sys/sockio.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h utmp.h utmpx.h) +AC_CHECK_HEADERS(unistd.h stdlib.h string.h sys/filio.h sys/sockio.h) +AC_CHECK_HEADERS(sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h) +AC_CHECK_HEADERS(sys/ptyvar.h utmp.h utmpx.h stdarg.h) AC_REPLACE_FUNCS(getdtablesize) DECLARE_SYS_ERRLIST KRB5_SIGTYPE diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c index 42bb65591..e47c0fd94 100644 --- a/src/appl/bsd/krcp.c +++ b/src/appl/bsd/krcp.c @@ -57,6 +57,11 @@ char copyright[] = #ifdef HAVE_VFORK_H #include <vfork.h> #endif +#ifdef HAVE_STDARG_H +#include <stdarg.h> +#else +#include <varargs.h> +#endif #ifdef HAVE_SETRESUID #ifndef HAVE_SETREUID @@ -126,8 +131,12 @@ struct buffer { #define NULLBUF (struct buffer *) 0 - /*VARARGS*/ - int error(); +#ifdef HAVE_STDARG_H +int error KRB5_PROTOTYPE((char *fmt, ...)); +#else +/*VARARGS*/ +int error KRB5_PROTOTYPE((char *, va_list)); +#endif #define ga() (void) des_write(rem, "", 1) @@ -1118,16 +1127,29 @@ struct buffer *allocbuf(bp, fd, blksize) +#ifdef HAVE_STDARG_H +error(char *fmt, ...) +#else /*VARARGS1*/ -error(fmt, a1, a2, a3, a4, a5) +error(fmt, va_alist) char *fmt; - int a1, a2, a3, a4, a5; + va_dcl +#endif { + va_list ap; char buf[RCP_BUFSIZ], *cp = buf; - + +#ifdef HAVE_STDARG_H + va_start(ap, fmt); +#else + va_start(ap); +#endif + errs++; *cp++ = 1; - (void) sprintf(cp, fmt, a1, a2, a3, a4, a5); + (void) vsprintf(cp, fmt, ap); + va_end(ap); + (void) des_write(rem, buf, strlen(buf)); if (iamremote == 0) (void) write(2, buf+1, strlen(buf+1)); |
