Trivial bug/fix for shm.c

From: Eric Weigle (ehw@lanl.gov)
Date: Thu Feb 22 2001 - 16:04:47 EST


I couldn't find the maintainer for this, so I'm sending it to the list.

Problem: ipc/shm.c currently assumes proc filesystem exists, so if
CONFIG_PROC_FS is not defined, it will not compile. The function shm_init calls
create_proc_read_entry without checking if CONFIG_PROC_FS defined; if it isn't
defined that functionality should not be referenced.

Solution: add appropriate #ifdef around that line:

--------------------------------------------------------------------------------
--- kernel-2.4.2/ipc/shm.c.orig Thu Feb 22 13:13:47 2001
+++ kernel-2.4.2/ipc/shm.c Thu Feb 22 13:13:57 2001
@@ -71,7 +71,9 @@
 void __init shm_init (void)
 {
    ipc_init_ids(&shm_ids, 1);
+#ifdef CONFIG_PROC_FS
    create_proc_read_entry("sysvipc/shm", 0, 0, sysvipc_shm_read_proc, NULL);
+#endif
 }

 static inline int shm_checkid(struct shmid_kernel *s, int id)
--------------------------------------------------------------------------------

I encountered this bug while creating a vastly hacked-down special purpose
kernel without /proc support.

Thanks,
-Eric Weigle

--------------------------------------------
 Eric H. Weigle CCS-1, RADIANT team
 ehw@lanl.gov Los Alamos National Lab
 (505) 665-4937 http://home.lanl.gov/ehw/
--------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 23 2001 - 21:00:28 EST