diff options
author | Telemaque Ndizihiwe | 2005-06-23 00:10:33 -0700 |
---|---|---|
committer | Linus Torvalds | 2005-06-23 09:45:36 -0700 |
commit | fed2fc18a4567d613cd35115322257c6c6c710e9 (patch) | |
tree | 937d8584966661b72cd7f71a6a6e4f0b97350760 /fs/open.c | |
parent | 64ccd715d3cf498318b14b646ce5f97e7ab15bb5 (diff) |
[PATCH] sys_open() cleanup
Clean up tortured logic in sys_open().
Signed-off-by: Telemaque Ndizihiwe <telendiz@eircom.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/open.c b/fs/open.c index 5dd411b084bf..8ec63f735918 100644 --- a/fs/open.c +++ b/fs/open.c @@ -934,7 +934,7 @@ EXPORT_SYMBOL(fd_install); asmlinkage long sys_open(const char __user * filename, int flags, int mode) { char * tmp; - int fd, error; + int fd; if (force_o_largefile()) flags |= O_LARGEFILE; @@ -945,20 +945,16 @@ asmlinkage long sys_open(const char __user * filename, int flags, int mode) fd = get_unused_fd(); if (fd >= 0) { struct file *f = filp_open(tmp, flags, mode); - error = PTR_ERR(f); - if (IS_ERR(f)) - goto out_error; - fd_install(fd, f); + if (IS_ERR(f)) { + put_unused_fd(fd); + fd = PTR_ERR(f); + } else { + fd_install(fd, f); + } } -out: putname(tmp); } return fd; - -out_error: - put_unused_fd(fd); - fd = error; - goto out; } EXPORT_SYMBOL_GPL(sys_open); |