lkml.org 
[lkml]   [2020]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 16/17] init: open code setting up stdin/stdout/stderr
On Thu, Jul 9, 2020 at 11:19 AM Christoph Hellwig <hch@lst.de> wrote:
>
> Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work, but
> instead open a struct file for /dev/console and then install it as FD
> 0/1/2 manually.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/file.c | 7 +------
> include/linux/syscalls.h | 1 -
> init/main.c | 16 ++++++++++------
> 3 files changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/fs/file.c b/fs/file.c
> index abb8b7081d7a44..85b7993165dd2f 100644
> --- a/fs/file.c
> +++ b/fs/file.c
> @@ -985,7 +985,7 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
> return ksys_dup3(oldfd, newfd, 0);
> }
>
> -int ksys_dup(unsigned int fildes)
> +SYSCALL_DEFINE1(dup, unsigned int, fildes)
> {
> int ret = -EBADF;
> struct file *file = fget_raw(fildes);
> @@ -1000,11 +1000,6 @@ int ksys_dup(unsigned int fildes)
> return ret;
> }
>
> -SYSCALL_DEFINE1(dup, unsigned int, fildes)
> -{
> - return ksys_dup(fildes);
> -}
> -

Please split the removal of the now unused ksys_*() functions into a
separate patch.

--
Brian Gerst

\
 
 \ /
  Last update: 2020-07-09 20:34    [W:0.109 / U:1.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site