> > +#ifdef CONFIG_FORK_CONNECTOR [...] > > +static inline void fork_connector(pid_t parent, pid_t child) > > +{ [...] > > +} > > +#else > > +static inline void fork_connector(pid_t parent, pid_t child) > > +{ > > + return; > > +} > > +#endif [...] > > @@ -1238,6 +1281,8 @@ long do_fork(unsigned long clone_flags, > > if (unlikely (current->ptrace & > > PT_TRACE_VFORK_DONE)) > > ptrace_notify ((PTRACE_EVENT_VFORK_DONE << > > 8) | SIGTRAP); > > } > > + > > + fork_connector(current->pid, p->pid); > > } else { > > free_pidmap(pid); > > pid = PTR_ERR(p);
> Guillaume, I see that you are trying to discover if the kernel has > CONFIG_FORK_CONNECTOR defined or not. In case CONFIG_FORK_CONNECTOR is > not defined, you will call a "dummy" fork_connector (which just call > "return"). But why you dont move the checking to where you call > fork_connector? In this case, if CONFIG_FORK_CONNECTOR is not defined, > nothing called, and of course you dont need a "dummy" fork_connector > like in the above code. > > Just try something like this: > > +#ifdef CONFIG_FORK_CONNECTOR > + > + fork_connector(current->pid, p->pid); > #endif No, Guillaume did it right. Don't litter the code with useless #ifdefs that turn one simple line of code into three for no good. The dummy routine is optimized away by the compiler anyways. Only the name "fork_connector()" might be discussed... Tim - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/