Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fsck_lfs Remove pointless function indirection through ...



details:   https://anonhg.NetBSD.org/src/rev/6186726b0ec4
branches:  trunk
changeset: 330512:6186726b0ec4
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Jul 12 19:44:00 2014 +0000

description:
Remove pointless function indirection through panic_func(). It was
initialized to one thing, and then set to another right at the top of
main and never changed again.

diffstat:

 sbin/fsck_lfs/lfs.c  |  13 +++----------
 sbin/fsck_lfs/main.c |   4 +---
 2 files changed, 4 insertions(+), 13 deletions(-)

diffs (71 lines):

diff -r 5581fd8deb78 -r 6186726b0ec4 sbin/fsck_lfs/lfs.c
--- a/sbin/fsck_lfs/lfs.c       Sat Jul 12 19:21:48 2014 +0000
+++ b/sbin/fsck_lfs/lfs.c       Sat Jul 12 19:44:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.41 2013/10/19 01:09:58 christos Exp $ */
+/* $NetBSD: lfs.c,v 1.42 2014/07/12 19:44:00 dholland Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -85,6 +85,7 @@
 #include <unistd.h>
 #include <util.h>
 
+#include "fsutil.h"
 #include "bufcache.h"
 #include "vnode.h"
 #include "lfs_user.h"
@@ -107,7 +108,6 @@
 lfs_fragextend(struct uvnode *, int, int, daddr_t, struct ubuf **);
 
 int fsdirty = 0;
-void (*panic_func)(int, const char *, va_list) = my_vpanic;
 
 /*
  * LFS buffer and uvnode operations
@@ -835,19 +835,12 @@
 
 /* print message and exit */
 void
-my_vpanic(int fatal, const char *fmt, va_list ap)
-{
-        (void) vprintf(fmt, ap);
-       exit(8);
-}
-
-void
 call_panic(const char *fmt, ...)
 {
        va_list ap;
 
        va_start(ap, fmt);
-        panic_func(1, fmt, ap);
+        vmsg(1, fmt, ap);
        va_end(ap);
 }
 
diff -r 5581fd8deb78 -r 6186726b0ec4 sbin/fsck_lfs/main.c
--- a/sbin/fsck_lfs/main.c      Sat Jul 12 19:21:48 2014 +0000
+++ b/sbin/fsck_lfs/main.c      Sat Jul 12 19:44:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.46 2014/07/12 16:11:27 dholland Exp $    */
+/* $NetBSD: main.c,v 1.47 2014/07/12 19:44:00 dholland Exp $    */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -57,7 +57,6 @@
 static int checkfilesys(const char *, char *, long, int);
 static void usage(void);
 static void efun(int, const char *, ...);
-extern void (*panic_func)(int, const char *, va_list);
 
 static void
 efun(int eval, const char *fmt, ...)
@@ -81,7 +80,6 @@
        skipclean = 1;
        exitonfail = 0;
        idaddr = 0x0;
-       panic_func = vmsg;
        esetfunc(efun);
        while ((ch = getopt(argc, argv, optstring)) != -1) {
                switch (ch) {



Home | Main Index | Thread Index | Old Index