diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -69,17 +69,18 @@ int suid_dumpable = 0; | |||
69 | static LIST_HEAD(formats); | 69 | static LIST_HEAD(formats); |
70 | static DEFINE_RWLOCK(binfmt_lock); | 70 | static DEFINE_RWLOCK(binfmt_lock); |
71 | 71 | ||
72 | int register_binfmt(struct linux_binfmt * fmt) | 72 | int __register_binfmt(struct linux_binfmt * fmt, int insert) |
73 | { | 73 | { |
74 | if (!fmt) | 74 | if (!fmt) |
75 | return -EINVAL; | 75 | return -EINVAL; |
76 | write_lock(&binfmt_lock); | 76 | write_lock(&binfmt_lock); |
77 | list_add(&fmt->lh, &formats); | 77 | insert ? list_add(&fmt->lh, &formats) : |
78 | list_add_tail(&fmt->lh, &formats); | ||
78 | write_unlock(&binfmt_lock); | 79 | write_unlock(&binfmt_lock); |
79 | return 0; | 80 | return 0; |
80 | } | 81 | } |
81 | 82 | ||
82 | EXPORT_SYMBOL(register_binfmt); | 83 | EXPORT_SYMBOL(__register_binfmt); |
83 | 84 | ||
84 | void unregister_binfmt(struct linux_binfmt * fmt) | 85 | void unregister_binfmt(struct linux_binfmt * fmt) |
85 | { | 86 | { |