go/src/os
Fazlul Shahriar 78d4560793 cmd/go/internal/lockedfile, os: fix O_CREATE flag on Plan 9
os.OpenFile was assuming that a failed syscall.Open means the file does
not exist and it tries to create it. However, syscall.Open may have
failed for some other reason, such as failing to lock a os.ModeExclusive
file. We change os.OpenFile to only create the file if the error
indicates that the file doesn't exist.

Remove skip of TestTransform test, which was failing because sometimes
syscall.Open would fail due to the file being locked, but the
syscall.Create would succeed because the file is no longer locked. The
create was truncating the file.

Fixes #35471

Change-Id: I06583b5f8ac33dc90a51cc4fb64f2d8d9c0c2113
Reviewed-on: https://go-review.googlesource.com/c/go/+/206299
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-11-09 22:14:01 +00:00
..
exec os/exec: skip possible netpoll pipe in known FDs in test 2019-10-22 08:54:50 +00:00
signal os/signal: use a larger channel buffer for all signals in TestSignal 2019-11-09 00:36:15 +00:00
user all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
dir.go os: change Readdirnames doc to follow that of Readdir 2019-08-02 21:52:01 +00:00
dir_darwin.go syscall: avoid _getdirentries64 on darwin 2019-04-03 21:27:05 +00:00
dir_plan9.go
dir_unix.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
dir_windows.go
env.go
env_default.go os: pass correct environment when creating Windows processes 2019-05-16 10:24:10 +00:00
env_test.go
env_unix_test.go
env_windows.go os: pass correct environment when creating Windows processes 2019-05-16 10:24:10 +00:00
error.go os: fix reference to nonexistent errors.Wrapper 2019-11-07 02:14:17 +00:00
error_errno.go os: don't consult Is methods on non-syscall error types 2019-08-02 21:09:50 +00:00
error_plan9.go os: don't consult Is methods on non-syscall error types 2019-08-02 21:09:50 +00:00
error_posix.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
error_test.go os: don't consult Is methods on non-syscall error types 2019-08-02 21:09:50 +00:00
error_unix_test.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
error_windows_test.go
example_test.go os: don't leak file in ExampleOpenFile_append failure path 2019-04-11 21:47:52 +00:00
exec.go
exec_plan9.go os/exec: less allocs in the common case 2019-03-04 09:45:46 +00:00
exec_posix.go os: keep attr.Files alive when calling StartProcess 2019-10-15 20:34:04 +00:00
exec_unix.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
exec_windows.go Revert "os: remove sleep in windows Process.Wait" 2018-11-09 23:24:35 +00:00
executable.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
executable_darwin.go
executable_freebsd.go
executable_path.go
executable_plan9.go
executable_procfs.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
executable_solaris.go
executable_test.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
executable_windows.go
export_test.go os: use an actual RemoveAll failure in TestRemoveAllWithMoreErrorThanReqSize 2019-10-26 01:46:02 +00:00
export_unix_test.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
export_windows_test.go
fifo_test.go
file.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
file_plan9.go cmd/go/internal/lockedfile, os: fix O_CREATE flag on Plan 9 2019-11-09 22:14:01 +00:00
file_posix.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
file_unix.go os: allow case only renames on case-insensitive filesystems 2019-11-01 00:04:51 +00:00
file_windows.go doc: clarify safety of multiple and concurent os.(*File).Close() calls 2019-06-05 21:21:59 +00:00
getwd.go
getwd_darwin.go
os_test.go os: allow case only renames on case-insensitive filesystems 2019-11-01 00:04:51 +00:00
os_unix_test.go os: deflake TestNewFileNonBlock 2019-05-30 22:39:04 +00:00
os_windows_test.go src: gofmt -s 2019-09-09 18:57:05 +00:00
path.go os: return from TestRemoveAllWithMoreErrorThanReqSize when RemoveAll succeeds on Windows 2019-10-29 18:24:40 +00:00
path_plan9.go
path_test.go os: add support for long path names on unix RemoveAll 2018-10-31 13:55:01 +00:00
path_unix.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
path_windows.go
path_windows_test.go
pipe2_bsd.go
pipe_bsd.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
pipe_linux.go
pipe_test.go os: deflake TestFdReadRace by increasing timeout 2019-10-11 19:58:27 +00:00
proc.go os: document exit status range value 2019-03-27 04:37:34 +00:00
rawconn.go os: add SyscallConn method for os.File 2018-12-27 16:36:34 +00:00
rawconn_test.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
removeall_at.go os: use an actual RemoveAll failure in TestRemoveAllWithMoreErrorThanReqSize 2019-10-26 01:46:02 +00:00
removeall_noat.go os: gofmt 2019-11-01 07:59:09 +00:00
removeall_test.go os: return from TestRemoveAllWithMoreErrorThanReqSize when RemoveAll succeeds on Windows 2019-10-29 18:24:40 +00:00
stat.go
stat_aix.go
stat_darwin.go
stat_dragonfly.go
stat_freebsd.go syscall: revert to pre-FreeBSD 10 / POSIX-2008 timespec field names in Stat_t on FreeBSD 2018-12-30 19:36:52 +00:00
stat_js.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
stat_linux.go
stat_netbsd.go
stat_openbsd.go
stat_plan9.go
stat_solaris.go
stat_test.go os: use CreateFile for Stat of symlinks 2018-11-02 07:30:03 +00:00
stat_unix.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
stat_windows.go os: return an error when the argument of Mkdir on Windows is os.DevNull 2019-08-29 09:53:56 +00:00
sticky_bsd.go os,syscall: implement functions related to uid, gid and pid on js/wasm 2019-03-22 15:40:37 +00:00
sticky_notbsd.go os,syscall: implement functions related to uid, gid and pid on js/wasm 2019-03-22 15:40:37 +00:00
str.go
sys.go
sys_aix.go
sys_bsd.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
sys_js.go
sys_linux.go
sys_plan9.go
sys_solaris.go
sys_unix.go
sys_windows.go
timeout_test.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
types.go
types_plan9.go
types_unix.go
types_windows.go os: fix windows Lstat missing name for some files 2019-03-20 08:35:29 +00:00
wait_unimp.go all: remove the nacl port (part 1) 2019-10-09 06:14:44 +00:00
wait_wait6.go all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
wait_waitid.go all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00