Re: Implementing hooks

From: Greg KH (gregat_private)
Date: Mon Apr 23 2001 - 10:41:35 PDT

  • Next message: richard offer: "Re: Source Control"

    On Thu, Apr 19, 2001 at 08:22:44PM -0700, Andrew Morgan wrote:
    > > If you can, do this, then I totally agree with you.  My knowledge of the
    > > gcc preprocessor isn't sufficient to figure out how to do this.
    > 
    > In the case of the above macro, something like this (yes, I tested it!)
    > should be fine:
    > 
    > =========
    > 
    > #define SECURITY_HOOK_RETURN_ERROR(ret,major,minor,args,description) \
    >     do { \
    >        ret = security_module->major->minor args ; \
    >        if (ret) \
    >            return ret; \
    >     } while (0)
    
    Ok, that makes a lot more sense.  Chris and Steve here also pointed out
    to me how to do just this, right after I posted my message to you :)
    
    Sure, a #define like that works for me.  But having a macro do a return
    isn't the nicest thing to do, hence the cleanup of a lot of that in the
    current kernel a few versions ago.
    
    thanks for explaining it.
    
    greg k-h
    
    
    _______________________________________________
    linux-security-module mailing list
    linux-security-moduleat_private
    http://mail.wirex.com/mailman/listinfo/linux-security-module
    



    This archive was generated by hypermail 2b30 : Mon Apr 23 2001 - 10:42:50 PDT