Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207300
b: refs/heads/master
c: 2ee7c92
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Aug 10, 2010
1 parent 2c7083c commit 9cbda10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5bf1d290b57e392eaf4bfb15c67f315fce4140be
refs/heads/master: 2ee7c922f20c96dba56fd378a466790d87f42e84
22 changes: 5 additions & 17 deletions trunk/kernel/exec_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,14 @@ unregister_exec_domain(struct exec_domain *ep)
return 0;
}

int
__set_personality(unsigned int personality)
int __set_personality(unsigned int personality)
{
struct exec_domain *ep, *oep;

ep = lookup_exec_domain(personality);
if (ep == current_thread_info()->exec_domain) {
current->personality = personality;
module_put(ep->module);
return 0;
}
struct exec_domain *oep = current_thread_info()->exec_domain;

current_thread_info()->exec_domain = lookup_exec_domain(personality);
current->personality = personality;
oep = current_thread_info()->exec_domain;
current_thread_info()->exec_domain = ep;

module_put(oep->module);

return 0;
}

Expand Down Expand Up @@ -192,11 +183,8 @@ SYSCALL_DEFINE1(personality, unsigned int, personality)
{
unsigned int old = current->personality;

if (personality != 0xffffffff) {
if (personality != 0xffffffff)
set_personality(personality);
if (current->personality != personality)
return -EINVAL;
}

return old;
}
Expand Down

0 comments on commit 9cbda10

Please sign in to comment.