patch-2.2.0-pre3 linux/fs/binfmt_misc.c

Next file: linux/fs/buffer.c
Previous file: linux/drivers/sound/sound_config.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre2/linux/fs/binfmt_misc.c linux/fs/binfmt_misc.c
@@ -67,7 +67,7 @@
 static int free_id = 1;
 static int enabled = 1;
 
-#ifdef __SMP__
+#ifdef CONFIG_SMP
 static rwlock_t entries_lock = RW_LOCK_UNLOCKED;
 #endif
 
@@ -179,26 +179,23 @@
 	struct dentry * dentry;
 	char iname[128];
 	char *iname_addr = iname;
-	int retval, fmt_flags = 0;
+	int retval;
 
 	MOD_INC_USE_COUNT;
-	if (!enabled) {
-		retval = -ENOEXEC;
+	retval = -ENOEXEC;
+	if (!enabled)
 		goto _ret;
-	}
 
 	/* to keep locking time low, we copy the interpreter string */
 	read_lock(&entries_lock);
-	if ((fmt = check_file(bprm))) {
+	fmt = check_file(bprm);
+	if (fmt) {
 		strncpy(iname, fmt->interpreter, 127);
 		iname[127] = '\0';
-		fmt_flags = fmt->flags;
 	}
 	read_unlock(&entries_lock);
-	if (!fmt) {
-		retval = -ENOEXEC;
+	if (!fmt)
 		goto _ret;
-	}
 
 	dput(bprm->dentry);
 	bprm->dentry = NULL;
@@ -209,10 +206,9 @@
 	bprm->argc++;
 	bprm->p = copy_strings(1, &iname_addr, bprm->page, bprm->p, 2);
 	bprm->argc++;
-	if (!bprm->p) {
-		retval = -E2BIG;
+	retval = -E2BIG;
+	if (!bprm->p)
 		goto _ret;
-	}
 	bprm->filename = iname;	/* for binfmt_script */
 
 	dentry = open_namei(iname, 0, 0);
@@ -452,9 +448,7 @@
  */
 static void entry_proc_cleanup(struct binfmt_entry *e)
 {
-#ifdef CONFIG_PROC_FS
 	remove_proc_entry(e->proc_name, bm_dir);
-#endif
 }
 
 /*
@@ -462,7 +456,6 @@
  */
 static int entry_proc_setup(struct binfmt_entry *e)
 {
-#ifdef CONFIG_PROC_FS
 	if (!(e->proc_dir = create_proc_entry(e->proc_name,
 			 	S_IFREG | S_IRUGO | S_IWUSR, bm_dir)))
 		return -ENOMEM;
@@ -470,7 +463,6 @@
 	e->proc_dir->data = (void *) (e->id);
 	e->proc_dir->read_proc = proc_read_status;
 	e->proc_dir->write_proc = proc_write_status;
-#endif
 	return 0;
 }
 
@@ -495,7 +487,6 @@
 int __init init_misc_binfmt(void)
 {
 	int error = -ENOMEM;
-#ifdef CONFIG_PROC_FS
 	struct proc_dir_entry *status = NULL, *reg;
 
 	bm_dir = create_proc_entry("sys/fs/binfmt_misc", S_IFDIR, NULL);
@@ -516,7 +507,6 @@
 	if (!reg)
 		goto cleanup_status;
 	reg->write_proc = proc_write_register;
-#endif /* CONFIG_PROC_FS */
 
 	error = register_binfmt(&misc_format);
 out:

FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected]