Author: delphij
Date: Sun Nov 21 12:40:16 2010
New Revision: 215628
URL: http://svn.freebsd.org/changeset/base/215628

Log:
  MFC r214125:
  
  In syscall_module_handler(): all switch branches return, remove
  unreached code as pointed out in a Chinese forum [1].
  
  [1] http://www.freebsdchina.org/forum/viewtopic.php?t=50619
  
  Pointed out by:               btw616 <btw s qq com>
  
  MFC r214181:
  
  Call chainevh callback when we are invoked with neither MOD_LOAD nor
  MOD_UNLOAD.  This makes it possible to add custom hooks for other module
  events.
  
  Return EOPNOTSUPP when there is no callback available.
  
  Pointed out by:       jhb
  Reviewed by:  jhb

Modified:
  stable/8/sys/kern/kern_syscalls.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/kern_syscalls.c
==============================================================================
--- stable/8/sys/kern/kern_syscalls.c   Sun Nov 21 12:33:11 2010        
(r215627)
+++ stable/8/sys/kern/kern_syscalls.c   Sun Nov 21 12:40:16 2010        
(r215628)
@@ -127,13 +127,12 @@ syscall_module_handler(struct module *mo
                error = syscall_deregister(data->offset, &data->old_sysent);
                return (error);
        default:
-               return EOPNOTSUPP;
+               if (data->chainevh)
+                       return (data->chainevh(mod, what, data->chainarg));
+               return (EOPNOTSUPP);
        }
 
-       if (data->chainevh)
-               return (data->chainevh(mod, what, data->chainarg));
-       else
-               return (0);
+       /* NOTREACHED */
 }
 
 int
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to