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 | |
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')
-rw-r--r-- | sys/ddb/db_output.c | 6 | ||||
-rw-r--r-- | sys/ddb/ddb.h | 2 | ||||
-rw-r--r-- | sys/kern/subr_witness.c | 12 |
3 files changed, 11 insertions, 9 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); diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index ef1bc39..02e2da4 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -343,10 +343,10 @@ static int sysctl_debug_witness_fullgraph(SYSCTL_HANDLER_ARGS); static void witness_add_fullgraph(struct sbuf *sb, struct witness *parent); #ifdef DDB static void witness_ddb_compute_levels(void); -static void witness_ddb_display(void(*)(const char *fmt, ...)); -static void witness_ddb_display_descendants(void(*)(const char *fmt, ...), +static void witness_ddb_display(int(*)(const char *fmt, ...)); +static void witness_ddb_display_descendants(int(*)(const char *fmt, ...), struct witness *, int indent); -static void witness_ddb_display_list(void(*prnt)(const char *fmt, ...), +static void witness_ddb_display_list(int(*prnt)(const char *fmt, ...), struct witness_list *list); static void witness_ddb_level_descendants(struct witness *parent, int l); static void witness_ddb_list(struct thread *td); @@ -908,7 +908,7 @@ witness_ddb_level_descendants(struct witness *w, int l) } static void -witness_ddb_display_descendants(void(*prnt)(const char *fmt, ...), +witness_ddb_display_descendants(int(*prnt)(const char *fmt, ...), struct witness *w, int indent) { int i; @@ -938,7 +938,7 @@ witness_ddb_display_descendants(void(*prnt)(const char *fmt, ...), } static void -witness_ddb_display_list(void(*prnt)(const char *fmt, ...), +witness_ddb_display_list(int(*prnt)(const char *fmt, ...), struct witness_list *list) { struct witness *w; @@ -953,7 +953,7 @@ witness_ddb_display_list(void(*prnt)(const char *fmt, ...), } static void -witness_ddb_display(void(*prnt)(const char *fmt, ...)) +witness_ddb_display(int(*prnt)(const char *fmt, ...)) { struct witness *w; |