From ced4d6fd2d415d43c0f26e01fe332e4afa80114a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 6 Aug 2022 13:28:20 -0700 Subject: syscall: rename close to closeFD ...to avoid conflicts with the predeclared close function. Change-Id: If6a19a004c390f4e0795ec207c72caa79a7281f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/421934 Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Reviewed-by: Tobias Klauser Auto-Submit: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- src/syscall/exec_libc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/syscall/exec_libc.go') diff --git a/src/syscall/exec_libc.go b/src/syscall/exec_libc.go index aee1b8c98a..72f73a268a 100644 --- a/src/syscall/exec_libc.go +++ b/src/syscall/exec_libc.go @@ -43,7 +43,7 @@ func runtime_AfterForkInChild() func chdir(path uintptr) (err Errno) func chroot1(path uintptr) (err Errno) -func close(fd uintptr) (err Errno) +func closeFD(fd uintptr) (err Errno) func dup2child(old uintptr, new uintptr) (val uintptr, err Errno) func execve(path uintptr, argv uintptr, envp uintptr) (err Errno) func exit(code uintptr) @@ -240,7 +240,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr // Pass 2: dup fd[i] down onto i. for i = 0; i < len(fd); i++ { if fd[i] == -1 { - close(uintptr(i)) + closeFD(uintptr(i)) continue } if fd[i] == int(i) { @@ -265,7 +265,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr // Programs that know they inherit fds >= 3 will need // to set them close-on-exec. for i = len(fd); i < 3; i++ { - close(uintptr(i)) + closeFD(uintptr(i)) } // Detach fd 0 from tty -- cgit v1.3