summaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-11-23 02:00:47 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-11-23 02:00:47 +0000
commit06615f62b17d7de6e12d2f5ec6b88cf30af08413 (patch)
tree8766f208847d4876a6db619aebbf54d53b76eb44 /net/unix
parentfa9bdb574f4febb751848a685d9a9017e04e1d53 (diff)
Merge with Linux 2.4.0-test10.
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c22
-rw-r--r--net/unix/sysctl_net_unix.c2
2 files changed, 7 insertions, 17 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 407f8f6b6..7603a9221 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -8,7 +8,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Version: $Id: af_unix.c,v 1.105 2000/08/16 10:58:22 davem Exp $
+ * Version: $Id: af_unix.c,v 1.107 2000/10/19 01:05:36 davem Exp $
*
* Fixes:
* Linus Torvalds : Assorted bug cures.
@@ -46,6 +46,7 @@
* Artur Skawina : Hash function optimizations
* Alexey Kuznetsov : Full scale SMP. Lot of bugs are introduced 8)
* Malcolm Beattie : Set peercred for socketpair
+ * Michal Ostrowski : Module initialization cleanup.
*
*
* Known differences from reference BSD that was tested:
@@ -1845,16 +1846,12 @@ struct net_proto_family unix_family_ops = {
unix_create
};
-#ifdef MODULE
#ifdef CONFIG_SYSCTL
extern void unix_sysctl_register(void);
extern void unix_sysctl_unregister(void);
#endif
-int init_module(void)
-#else
-void __init unix_proto_init(struct net_proto *pro)
-#endif
+static int __init af_unix_init(void)
{
struct sk_buff *dummy_skb;
@@ -1862,28 +1859,21 @@ void __init unix_proto_init(struct net_proto *pro)
if (sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb))
{
printk(KERN_CRIT "unix_proto_init: panic\n");
-#ifdef MODULE
return -1;
-#else
- return;
-#endif
}
sock_register(&unix_family_ops);
#ifdef CONFIG_PROC_FS
create_proc_read_entry("net/unix", 0, 0, unix_read_proc, NULL);
#endif
-#ifdef MODULE
#ifdef CONFIG_SYSCTL
unix_sysctl_register();
#endif
return 0;
-#endif
}
-#ifdef MODULE
-void cleanup_module(void)
+static void __exit af_unix_exit(void)
{
sock_unregister(PF_UNIX);
#ifdef CONFIG_SYSCTL
@@ -1893,7 +1883,9 @@ void cleanup_module(void)
remove_proc_entry("net/unix", 0);
#endif
}
-#endif
+
+module_init(af_unix_init);
+module_exit(af_unix_exit);
/*
* Local variables:
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 744a4446a..885119da3 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -26,7 +26,6 @@ ctl_table unix_table[] = {
{0}
};
-#ifdef MODULE
static struct ctl_table_header * unix_sysctl_header;
static struct ctl_table unix_root_table[];
static struct ctl_table unix_net_table[];
@@ -50,6 +49,5 @@ void unix_sysctl_unregister(void)
{
unregister_sysctl_table(unix_sysctl_header);
}
-#endif /* MODULE */
#endif /* CONFIG_SYSCTL */