From: Matt H. <mat...@us...> - 2006-06-14 00:01:55
|
This patch changes process events so that it may be configured as a module. Signed-off-by: Matt Helsley <mat...@us...> Cc: Guillaume Thouvenin <gui...@bu...> -- drivers/connector/Kconfig | 8 ++++---- drivers/connector/cn_proc.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) Index: linux-2.6.17-rc6-mm2/drivers/connector/Kconfig =================================================================== --- linux-2.6.17-rc6-mm2.orig/drivers/connector/Kconfig +++ linux-2.6.17-rc6-mm2/drivers/connector/Kconfig @@ -9,13 +9,13 @@ config CONNECTOR Connector support can also be built as a module. If so, the module will be called cn.ko. config PROC_EVENTS - boolean "Report process events to userspace" - depends on CONNECTOR=y - default y - ---help--- + tristate "Report process events to userspace" + default m + depends on CONNECTOR + help Provide a connector that reports process events to userspace. Send events such as fork, exec, id change (uid, gid, suid, etc), and exit. endmenu Index: linux-2.6.17-rc6-mm2/drivers/connector/cn_proc.c =================================================================== --- linux-2.6.17-rc6-mm2.orig/drivers/connector/cn_proc.c +++ linux-2.6.17-rc6-mm2/drivers/connector/cn_proc.c @@ -224,6 +224,24 @@ static int __init cn_proc_init(void) cn_del_callback(&cn_proc_event_id); out: return err; } +static void cn_proc_fini(void) +{ + int err; + + err = unregister_task_watcher(&cn_proc_nb); + if (err != 0) + printk(KERN_WARNING + "cn_proc failed to unregister its task notify block\n"); + + cn_del_callback(&cn_proc_event_id); +} + module_init(cn_proc_init); +module_exit(cn_proc_fini); + +MODULE_AUTHOR("Matt Helsley <mat...@us...>"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Notification of process events."); +MODULE_VERSION("2:1.0"); -- |