diff options
author | attilio <attilio@FreeBSD.org> | 2010-05-11 17:01:14 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2010-05-11 17:01:14 +0000 |
commit | a6a1f012b778df297f5ac367cbd09a21823defe0 (patch) | |
tree | b27d5ec4ed70f3633f0abcab31f2d96e2440f5f6 /sys/ddb | |
parent | 31c196b3b94d81c997db90b6e80a55ceb02cb044 (diff) | |
download | FreeBSD-src-a6a1f012b778df297f5ac367cbd09a21823defe0.zip FreeBSD-src-a6a1f012b778df297f5ac367cbd09a21823defe0.tar.gz |
There is not a good reason to have a different prototype for db_printf()
when compared to printf().
Unify it by returning the number of characters displayed for db_printf()
as well.
MFC after: 7 days
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_output.c | 6 | ||||
-rw-r--r-- | sys/ddb/ddb.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 4f646c9..8390a86 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -316,7 +316,7 @@ db_print_position() /* * Printing */ -void +int db_printf(const char *fmt, ...) { #ifdef DDB_BUFR_SIZE @@ -324,6 +324,7 @@ db_printf(const char *fmt, ...) #endif struct dbputchar_arg dca; va_list listp; + int retval; #ifdef DDB_BUFR_SIZE dca.da_pbufr = bufr; @@ -336,13 +337,14 @@ db_printf(const char *fmt, ...) #endif va_start(listp, fmt); - kvprintf (fmt, db_putchar, &dca, db_radix, listp); + retval = kvprintf (fmt, db_putchar, &dca, db_radix, listp); va_end(listp); #ifdef DDB_BUFR_SIZE if (*dca.da_pbufr != '\0') db_puts(dca.da_pbufr); #endif + return (retval); } int db_indent; diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index e6d8a95..9b240b6 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -200,7 +200,7 @@ int db_md_clr_watchpoint(db_expr_t addr, db_expr_t size); void db_md_list_watchpoints(void); void db_print_loc_and_inst(db_addr_t loc); void db_print_thread(void); -void db_printf(const char *fmt, ...) __printflike(1, 2); +int db_printf(const char *fmt, ...) __printflike(1, 2); int db_read_bytes(vm_offset_t addr, size_t size, char *data); /* machine-dependent */ int db_readline(char *lstart, int lsize); |