=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdist/common.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/usr.bin/rdist/common.c 2014/07/05 05:05:51 1.27 +++ src/usr.bin/rdist/common.c 2014/07/05 06:18:58 1.28 @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.27 2014/07/05 05:05:51 guenther Exp $ */ +/* $OpenBSD: common.c,v 1.28 2014/07/05 06:18:58 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -275,14 +275,10 @@ /* * Send a command message to the remote host. * Called as sendcmd(char cmdchar, char *fmt, arg1, arg2, ...) - * The fmt and arg? arguments are optional. + * The fmt may be NULL, in which case there are no args. */ -#if defined(ARG_TYPE) && ARG_TYPE == ARG_STDARG -/* - * Stdarg frontend to sendcmdmsg() - */ int -sendcmd(char cmd, char *fmt, ...) +sendcmd(char cmd, const char *fmt, ...) { static char buf[BUFSIZ]; va_list args; @@ -297,37 +293,8 @@ return(sendcmdmsg(cmd, buf, sizeof(buf))); } -#endif /* ARG_TYPE == ARG_STDARG */ -#if defined(ARG_TYPE) && ARG_TYPE == ARG_VARARGS /* - * Varargs frontend to sendcmdmsg() - */ -int -sendcmd(va_alist) - va_dcl -{ - static char buf[BUFSIZ]; - va_list args; - char cmd; - char *fmt; - - va_start(args); - /* XXX The "int" is necessary as a workaround for broken varargs */ - cmd = (char) va_arg(args, int); - fmt = va_arg(args, char *); - if (fmt) - (void) vsnprintf(buf + (cmd != C_NONE), - sizeof(buf) - (cmd != C_NONE), fmt, args); - else - buf[1] = CNULL; - va_end(args); - - return(sendcmdmsg(cmd, buf, sizeof(buf))); -} -#endif /* ARG_TYPE == ARG_VARARGS */ - -/* * Internal variables and routines for reading lines from the remote. */ static u_char rembuf[BUFSIZ]; @@ -918,21 +885,4 @@ *space = ' '; /* Put back what we zapped */ } return (file); -} - -/* - * Set line buffering. - */ -int -mysetlinebuf(FILE *fp) -{ -#if SETBUF_TYPE == SETBUF_SETLINEBUF - return(setlinebuf(fp)); -#endif /* SETBUF_SETLINEBUF */ -#if SETBUF_TYPE == SETBUF_SETVBUF - return(setvbuf(stdout, NULL, _IOLBF, BUFSIZ)); -#endif /* SETBUF_SETVBUF */ -#if !defined(SETBUF_TYPE) - No SETBUF_TYPE is defined! -#endif /* SETBUF_TYPE */ }