From 7045a26e173b385426de5cfec27aaf4fce06e71b Mon Sep 17 00:00:00 2001 From: WangRunji Date: Fri, 22 Mar 2019 19:05:13 +0800 Subject: [PATCH] remove initfd for ucore programs --- ucore/src/ulibs/umain.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/ucore/src/ulibs/umain.c b/ucore/src/ulibs/umain.c index 8c45ea3..7aa6106 100644 --- a/ucore/src/ulibs/umain.c +++ b/ucore/src/ulibs/umain.c @@ -5,31 +5,8 @@ int main(int argc, char *argv[]); -static int -initfd(int fd2, const char *path, uint32_t open_flags) { - int fd1; - if ((fd1 = open(path, open_flags)) < 0) { - return fd1; - } - int ret = fd1; - if (fd1 != fd2) { - close(fd2); - ret = dup2(fd1, fd2); - close(fd1); - } - return ret; -} - void umain(int argc, char *argv[]) { - int fd; - if ((fd = initfd(0, "stdin:", O_RDONLY)) < 0) { - warn("open failed: %e.\n", fd); - } - if ((fd = initfd(1, "stdout:", O_WRONLY)) < 0) { - warn("open failed: %e.\n", fd); - } int ret = main(argc, argv); exit(ret); } -