mirror of
https://github.com/golang/go
synced 2024-11-05 16:26:11 -07:00
os, cmd/link: fix typos
Also switch "stating" to "statting" to describe applying os.Stat to a resource; the former is more confusable than the latter. Change-Id: I9d8e3506bd383f8f1479c05948c03b8c633dc4af Reviewed-on: https://go-review.googlesource.com/42855 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
c08ac36761
commit
9058b9ae49
@ -1449,8 +1449,8 @@ func writearanges(ctxt *Link, syms []*Symbol) []*Symbol {
|
|||||||
|
|
||||||
func writegdbscript(ctxt *Link, syms []*Symbol) []*Symbol {
|
func writegdbscript(ctxt *Link, syms []*Symbol) []*Symbol {
|
||||||
if Linkmode == LinkExternal && Headtype == objabi.Hwindows {
|
if Linkmode == LinkExternal && Headtype == objabi.Hwindows {
|
||||||
// gcc on Windows places .debug_gdb_scripts to a wrong location
|
// gcc on Windows places .debug_gdb_scripts in the wrong location, which
|
||||||
// which causes program not to run. See https://golang.org/issue/20183
|
// causes the program not to run. See https://golang.org/issue/20183
|
||||||
return syms
|
return syms
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ func Stat(name string) (FileInfo, error) {
|
|||||||
return nil, &PathError{"Stat", name, err}
|
return nil, &PathError{"Stat", name, err}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use Windows I/O manager to dereferences the symbolic link, as per
|
// Use Windows I/O manager to dereference the symbolic link, as per
|
||||||
// https://blogs.msdn.microsoft.com/oldnewthing/20100212-00/?p=14963/
|
// https://blogs.msdn.microsoft.com/oldnewthing/20100212-00/?p=14963/
|
||||||
h, err := syscall.CreateFile(namep, 0, 0, nil,
|
h, err := syscall.CreateFile(namep, 0, 0, nil,
|
||||||
syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0)
|
syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0)
|
||||||
@ -103,7 +103,7 @@ func Stat(name string) (FileInfo, error) {
|
|||||||
vol: d.VolumeSerialNumber,
|
vol: d.VolumeSerialNumber,
|
||||||
idxhi: d.FileIndexHigh,
|
idxhi: d.FileIndexHigh,
|
||||||
idxlo: d.FileIndexLow,
|
idxlo: d.FileIndexLow,
|
||||||
// fileStat.path is used by os.SameFile to decide, if it needs
|
// fileStat.path is used by os.SameFile to decide if it needs
|
||||||
// to fetch vol, idxhi and idxlo. But these are already set,
|
// to fetch vol, idxhi and idxlo. But these are already set,
|
||||||
// so set fileStat.path to "" to prevent os.SameFile doing it again.
|
// so set fileStat.path to "" to prevent os.SameFile doing it again.
|
||||||
// Also do not set fileStat.filetype, because it is only used for
|
// Also do not set fileStat.filetype, because it is only used for
|
||||||
@ -111,8 +111,8 @@ func Stat(name string) (FileInfo, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// statWithFindFirstFile is used by Stat to handle special case of stating
|
// statWithFindFirstFile is used by Stat to handle special case of statting
|
||||||
// c:\pagefile.sys. We might discovered other files need similar treatment.
|
// c:\pagefile.sys. We might discover that other files need similar treatment.
|
||||||
func statWithFindFirstFile(name string, namep *uint16) (FileInfo, error) {
|
func statWithFindFirstFile(name string, namep *uint16) (FileInfo, error) {
|
||||||
var fd syscall.Win32finddata
|
var fd syscall.Win32finddata
|
||||||
h, err := syscall.FindFirstFile(namep, &fd)
|
h, err := syscall.FindFirstFile(namep, &fd)
|
||||||
|
Loading…
Reference in New Issue
Block a user