Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/perfused Mark perfused_panic as dead. Canonical for...



details:   https://anonhg.NetBSD.org/src/rev/097302dbbb6c
branches:  trunk
changeset: 773516:097302dbbb6c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Feb 04 18:36:30 2012 +0000

description:
Mark perfused_panic as dead. Canonical form of infinite loops is
for (;;). Remove completely redundant NOTREACHED markers.

diffstat:

 usr.sbin/perfused/msg.c      |   9 +--------
 usr.sbin/perfused/perfused.c |  11 +++--------
 usr.sbin/perfused/perfused.h |   4 ++--
 3 files changed, 6 insertions(+), 18 deletions(-)

diffs (94 lines):

diff -r 1d6d9bec3a00 -r 097302dbbb6c usr.sbin/perfused/msg.c
--- a/usr.sbin/perfused/msg.c   Sat Feb 04 18:35:56 2012 +0000
+++ b/usr.sbin/perfused/msg.c   Sat Feb 04 18:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: msg.c,v 1.19 2012/02/03 15:54:15 manu Exp $ */
+/*  $NetBSD: msg.c,v 1.20 2012/02/04 18:36:30 joerg Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -489,8 +489,6 @@
        switch (readen = recv(fd, data, len, MSG_NOSIGNAL|MSG_PEEK)) {
        case 0:
                perfused_panic();
-               /* NOTREACHED */
-               break;
        case -1:
                if (errno == EAGAIN)
                        return 0;
@@ -536,16 +534,11 @@
        case 0:
                DWARNX("%s: recv returned 0", __func__);
                perfused_panic();
-               
-               /* NOTREACHED */
-               break;
        case -1:
                if (errno == EAGAIN)
                        return 0;
                DWARN("%s: recv returned -1", __func__);
                return errno;
-               /* NOTREACHED */
-               break;
        default:
                break;
        }
diff -r 1d6d9bec3a00 -r 097302dbbb6c usr.sbin/perfused/perfused.c
--- a/usr.sbin/perfused/perfused.c      Sat Feb 04 18:35:56 2012 +0000
+++ b/usr.sbin/perfused/perfused.c      Sat Feb 04 18:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfused.c,v 1.21 2012/02/03 15:54:15 manu Exp $ */
+/*  $NetBSD: perfused.c,v 1.22 2012/02/04 18:36:30 joerg Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -455,12 +455,11 @@
        case SOCK_DGRAM:
                new_mount(s, PMNT_DEVFUSE|PMNT_DGRAM);
                exit(0);
-               break;
        case SOCK_SEQPACKET:
                if (listen(s, 0) != 0)
                        DERR(EX_OSERR, "listen failed");
 
-               do {
+               for (;;) {
                        int fd;
                        struct sockaddr_un sun;
                        struct sockaddr *sa;
@@ -471,8 +470,7 @@
                                DERR(EX_OSERR, "accept failed");
 
                        new_mount(fd, PMNT_DEVFUSE);
-               } while (1 /* CONSTCOND */);
-               break;
+               }
        default:
                DERRX(EX_SOFTWARE, "unexpected so_type %d", sock_type);
                break;
@@ -487,7 +485,4 @@
 {
        DWARNX("filesystem crashed");
        exit(EX_OK);
-
-       /* NOTREACHED */
-       return;
 }
diff -r 1d6d9bec3a00 -r 097302dbbb6c usr.sbin/perfused/perfused.h
--- a/usr.sbin/perfused/perfused.h      Sat Feb 04 18:35:56 2012 +0000
+++ b/usr.sbin/perfused/perfused.h      Sat Feb 04 18:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfused.h,v 1.9 2012/02/03 15:54:15 manu Exp $ */
+/*  $NetBSD: perfused.h,v 1.10 2012/02/04 18:36:30 joerg Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -66,7 +66,7 @@
 int perfused_xchg_pb(struct puffs_usermount *, perfuse_msg_t *, size_t, 
     enum perfuse_xchg_pb_reply);
 
-void perfused_panic(void);
+void perfused_panic(void) __dead;
 
 __END_DECLS
 



Home | Main Index | Thread Index | Old Index