From 3f08a1b8689869254a8b6f7be7d6bf99072c0083 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Mon, 6 Jul 2015 18:15:15 +0900 Subject: [PATCH] sbin/hammer: Remove panic() - hammer userspace mostly uses err()/errx() and panic() (which is only used once) can be replaced using these. --- sbin/hammer/hammer_util.h | 3 --- sbin/hammer/ondisk.c | 15 +-------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sbin/hammer/hammer_util.h b/sbin/hammer/hammer_util.h index ae22542180..ad37a8a8a7 100644 --- a/sbin/hammer/hammer_util.h +++ b/sbin/hammer/hammer_util.h @@ -168,6 +168,3 @@ void hammer_cache_used(struct cache_info *cache); void hammer_cache_flush(void); void score_printf(size_t i, size_t w, const char *ctl, ...) __printflike(3, 4); - -void panic(const char *ctl, ...) __printflike(1, 2); - diff --git a/sbin/hammer/ondisk.c b/sbin/hammer/ondisk.c index e9b0f806ef..be8b23424e 100644 --- a/sbin/hammer/ondisk.c +++ b/sbin/hammer/ondisk.c @@ -668,7 +668,7 @@ alloc_bigblock(struct volume_info *volume, int zone) result_offset = volume->vol_free_off; if (result_offset >= volume->vol_free_end) - panic("alloc_bigblock: Ran out of room, filesystem too small"); + errx(1, "alloc_bigblock: Ran out of room, filesystem too small"); volume->vol_free_off += HAMMER_BIGBLOCK_SIZE; /* @@ -1006,16 +1006,3 @@ writehammerbuf(struct volume_info *vol, const void *data, int64_t offset) if (n != HAMMER_BUFSIZE) err(1, "Write volume %d (%s)", vol->vol_no, vol->name); } - -void -panic(const char *ctl, ...) -{ - va_list va; - - va_start(va, ctl); - vfprintf(stderr, ctl, va); - va_end(va); - fprintf(stderr, "\n"); - exit(1); -} - -- 2.41.0