Skip to content

Commit ced4d6f

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 7e5e4a7 commit ced4d6f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/runtime/syscall_aix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ func syscall_chroot1(path uintptr) (err uintptr) {
127127

128128
// like close, but must not split stack, for fork.
129129
//
130-
//go:linkname syscall_close syscall.close
130+
//go:linkname syscall_closeFD syscall.closeFD
131131
//go:nosplit
132-
func syscall_close(fd int32) int32 {
132+
func syscall_closeFD(fd int32) int32 {
133133
_, err := syscall1(&libc_close, uintptr(fd))
134134
return int32(err)
135135
}

src/syscall/asm_solaris_amd64.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ TEXT ·chdir(SB),NOSPLIT,$0
2020
TEXT ·chroot1(SB),NOSPLIT,$0
2121
JMP runtime·syscall_chroot(SB)
2222

23-
TEXT ·close(SB),NOSPLIT,$0
23+
TEXT ·closeFD(SB),NOSPLIT,$0
2424
JMP runtime·syscall_close(SB)
2525

2626
TEXT ·dup2child(SB),NOSPLIT,$0

src/syscall/exec_libc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func runtime_AfterForkInChild()
4343

4444
func chdir(path uintptr) (err Errno)
4545
func chroot1(path uintptr) (err Errno)
46-
func close(fd uintptr) (err Errno)
46+
func closeFD(fd uintptr) (err Errno)
4747
func dup2child(old uintptr, new uintptr) (val uintptr, err Errno)
4848
func execve(path uintptr, argv uintptr, envp uintptr) (err Errno)
4949
func exit(code uintptr)
@@ -240,7 +240,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
240240
// Pass 2: dup fd[i] down onto i.
241241
for i = 0; i < len(fd); i++ {
242242
if fd[i] == -1 {
243-
close(uintptr(i))
243+
closeFD(uintptr(i))
244244
continue
245245
}
246246
if fd[i] == int(i) {
@@ -265,7 +265,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
265265
// Programs that know they inherit fds >= 3 will need
266266
// to set them close-on-exec.
267267
for i = len(fd); i < 3; i++ {
268-
close(uintptr(i))
268+
closeFD(uintptr(i))
269269
}
270270

271271
// Detach fd 0 from tty

0 commit comments

Comments
 (0)