]> Cypherpunks repositories - gostls13.git/commit
syscall: ensure Mkdir(path) on Plan 9 fails if path exists
authorRichard Miller <miller.research@gmail.com>
Mon, 19 Feb 2018 12:34:53 +0000 (12:34 +0000)
committerDavid du Colombier <0intro@gmail.com>
Tue, 20 Feb 2018 13:21:12 +0000 (13:21 +0000)
commita156fc08b7fd289bfc9979c77445f9e4741a7dfd
treed44a8ea6f9fe3c86fc89dd608b90595ed34dbf92
parent9b7f221a3af2ee8495129621a5012647ffe15eb1
syscall: ensure Mkdir(path) on Plan 9 fails if path exists

On Plan 9, the underlying create() syscall with DMDIR flag, which is
used to implement Mkdir, will fail silently if the path exists and
is not a directory.  Work around this by checking for existence
first and rejecting Mkdir with error EEXIST if the path is found.

Fixes #23918

Change-Id: I439115662307923c9f498d3e7b1f32c6d205e1ad
Reviewed-on: https://go-review.googlesource.com/94777
Reviewed-by: David du Colombier <0intro@gmail.com>
src/os/stat_plan9.go
src/syscall/syscall_plan9.go