diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index d4819bfe0656..526b402f7fdd 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: subr_bus.c,v 1.29 1999/05/30 10:27:11 dfr Exp $ + * $Id: subr_bus.c,v 1.30 1999/07/11 13:42:37 dfr Exp $ */ #include @@ -891,25 +891,27 @@ device_get_desc(device_t dev) return dev->desc; } -void +int device_print_prettyname(device_t dev) { const char *name = device_get_name(dev); if (name == 0) name = "(no driver assigned)"; - printf("%s%d: ", name, device_get_unit(dev)); + return(printf("%s%d: ", name, device_get_unit(dev))); } -void +int device_printf(device_t dev, const char * fmt, ...) { va_list ap; + int retval; - device_print_prettyname(dev); + retval = device_print_prettyname(dev); va_start(ap, fmt); - vprintf(fmt, ap); + retval += vprintf(fmt, ap); va_end(ap); + return retval; } static void diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 54924c7933dc..d9f0f2393201 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 - * $Id: subr_prf.c,v 1.56 1999/07/10 15:27:05 peter Exp $ + * $Id: subr_prf.c,v 1.57 1999/07/14 17:37:53 peter Exp $ */ #include @@ -102,20 +102,22 @@ tablefull(tab) * It may block if the tty queue is overfull. No message is printed if * the queue does not clear in a reasonable time. */ -void +int uprintf(const char *fmt, ...) { struct proc *p = curproc; va_list ap; struct putchar_arg pca; + int retval = 0; if (p->p_flag & P_CONTROLT && p->p_session->s_ttyvp) { va_start(ap, fmt); pca.tty = p->p_session->s_ttyp; pca.flags = TOTTY; - kvprintf(fmt, putchar, &pca, 10, ap); + retval = kvprintf(fmt, putchar, &pca, 10, ap); va_end(ap); } + return retval; } tpr_t @@ -143,7 +145,7 @@ tprintf_close(sess) * tprintf prints on the controlling terminal associated * with the given session. */ -void +int tprintf(tpr_t tpr, const char *fmt, ...) { register struct session *sess = (struct session *)tpr; @@ -151,6 +153,7 @@ tprintf(tpr_t tpr, const char *fmt, ...) int flags = TOLOG; va_list ap; struct putchar_arg pca; + int retval; logpri(LOG_INFO); if (sess && sess->s_ttyvp && ttycheckoutq(sess->s_ttyp, 0)) { @@ -160,9 +163,10 @@ tprintf(tpr_t tpr, const char *fmt, ...) va_start(ap, fmt); pca.tty = tp; pca.flags = flags; - kvprintf(fmt, putchar, &pca, 10, ap); + retval = kvprintf(fmt, putchar, &pca, 10, ap); va_end(ap); logwakeup(); + return retval; } /* @@ -170,16 +174,19 @@ tprintf(tpr_t tpr, const char *fmt, ...) * the tty driver, or anything that knows the underlying tty will not * be revoke(2)'d away. Other callers should use tprintf. */ -void +int ttyprintf(struct tty *tp, const char *fmt, ...) { va_list ap; struct putchar_arg pca; + int retval; + va_start(ap, fmt); pca.tty = tp; pca.flags = TOTTY; - kvprintf(fmt, putchar, &pca, 10, ap); + retval = kvprintf(fmt, putchar, &pca, 10, ap); va_end(ap); + return retval; } extern int log_open; @@ -189,17 +196,18 @@ extern int log_open; * called by interrupt routines). If there is no process reading the * log yet, it writes to the console also. */ -void +int log(int level, const char *fmt, ...) { register int s; va_list ap; + int retval; s = splhigh(); logpri(level); va_start(ap, fmt); - kvprintf(fmt, msglogchar, NULL, 10, ap); + retval = kvprintf(fmt, msglogchar, NULL, 10, ap); va_end(ap); splx(s); @@ -208,10 +216,11 @@ log(int level, const char *fmt, ...) va_start(ap, fmt); pca.tty = NULL; pca.flags = TOCONS; - kvprintf(fmt, putchar, &pca, 10, ap); + retval += kvprintf(fmt, putchar, &pca, 10, ap); va_end(ap); } logwakeup(); + return retval; } static void @@ -244,7 +253,7 @@ addlog(const char *fmt, ...) va_start(ap, fmt); pca.tty = NULL; pca.flags = TOCONS; - kvprintf(fmt, putchar, &pca, 10, ap); + retval += kvprintf(fmt, putchar, &pca, 10, ap); va_end(ap); } logwakeup(); @@ -272,20 +281,22 @@ printf(const char *fmt, ...) return retval; } -void +int vprintf(const char *fmt, va_list ap) { register int savintr; struct putchar_arg pca; + int retval; savintr = consintr; /* disable interrupts */ consintr = 0; pca.tty = NULL; pca.flags = TOCONS | TOLOG; - kvprintf(fmt, putchar, &pca, 10, ap); + retval = kvprintf(fmt, putchar, &pca, 10, ap); if (!panicstr) logwakeup(); consintr = savintr; /* reenable interrupts */ + return retval; } /* diff --git a/sys/sys/bus.h b/sys/sys/bus.h index fd90bcedf264..49ad58ea04d7 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bus.h,v 1.19 1999/05/30 10:27:02 dfr Exp $ + * $Id: bus.h,v 1.20 1999/07/04 14:58:55 phk Exp $ */ #ifndef _SYS_BUS_H_ @@ -237,8 +237,8 @@ int device_get_unit(device_t dev); int device_is_alive(device_t dev); /* did probe succeed? */ int device_is_enabled(device_t dev); int device_is_quiet(device_t dev); -void device_print_prettyname(device_t dev); -void device_printf(device_t dev, const char *, ...) __printflike(2, 3); +int device_print_prettyname(device_t dev); +int device_printf(device_t dev, const char *, ...) __printflike(2, 3); int device_probe_and_attach(device_t dev); void device_quiet(device_t dev); void device_set_desc(device_t dev, const char* desc); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index b3a3f60dacb9..4ddf974c872a 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $Id: systm.h,v 1.93 1999/07/20 21:29:01 green Exp $ + * $Id: systm.h,v 1.94 1999/07/23 23:45:50 alc Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -108,16 +108,16 @@ void tablefull __P((const char *)); int addlog __P((const char *, ...)) __printflike(1, 2); int kvprintf __P((char const *, void (*)(int, void*), void *, int, _BSD_VA_LIST_)) __printflike(1, 0); -void log __P((int, const char *, ...)) __printflike(2, 3); +int log __P((int, const char *, ...)) __printflike(2, 3); void logwakeup __P((void)); int printf __P((const char *, ...)) __printflike(1, 2); int snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4); int sprintf __P((char *buf, const char *, ...)) __printflike(2, 3); -void uprintf __P((const char *, ...)) __printflike(1, 2); -void vprintf __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0); +int uprintf __P((const char *, ...)) __printflike(1, 2); +int vprintf __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0); int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_)) __printflike(3, 0); int vsprintf __P((char *buf, const char *, _BSD_VA_LIST_)) __printflike(2, 0); -void ttyprintf __P((struct tty *, const char *, ...)) __printflike(2, 3); +int ttyprintf __P((struct tty *, const char *, ...)) __printflike(2, 3); int sscanf __P((const char *, char const *, ...)); int vsscanf __P((const char *, char const *, _BSD_VA_LIST_)); u_quad_t strtouq __P((const char *, const char **, int)); diff --git a/sys/sys/tprintf.h b/sys/sys/tprintf.h index 945a045260bc..239bb52a78e7 100644 --- a/sys/sys/tprintf.h +++ b/sys/sys/tprintf.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tprintf.h 8.1 (Berkeley) 6/2/93 - * $Id: tprintf.h,v 1.6 1998/02/03 21:51:58 bde Exp $ + * $Id: tprintf.h,v 1.7 1998/07/13 06:45:18 bde Exp $ */ #ifndef _SYS_TPRINTF_H_ @@ -44,6 +44,6 @@ struct proc; tpr_t tprintf_open __P((struct proc *)); void tprintf_close __P((tpr_t)); -void tprintf __P((tpr_t, const char *fmt, ...)) __printflike(2, 3); +int tprintf __P((tpr_t, const char *fmt, ...)) __printflike(2, 3); #endif