libc: refactoring

This commit is contained in:
2019-11-28 02:35:52 +01:00
parent f104c46858
commit 4067cb45cb
75 changed files with 596 additions and 355 deletions

View File

@@ -32,18 +32,18 @@ main(int argc, char *argv[])
pipe(sync);
outfd = dup(1);
nullfd = open("/dev/null", O_WRONLY);
nullfd = sys_open("/dev/null", O_WRONLY);
tmp = fcntl(sync[0], F_DUPFD_CLOEXEC, 1);
close(sync[0]);
sys_close(sync[0]);
sync[0] = tmp;
tmp = fcntl(sync[1], F_DUPFD_CLOEXEC, 1);
close(sync[1]);
sys_close(sync[1]);
sync[1] = tmp;
tmp = fcntl(outfd, F_DUPFD_CLOEXEC, 1);
close(outfd);
sys_close(outfd);
outfd = tmp;
tmp = fcntl(nullfd, F_DUPFD_CLOEXEC, 1);
close(nullfd);
sys_close(nullfd);
nullfd = tmp;
eargv[0] = argv[0];