summaryrefslogtreecommitdiff
path: root/libgo/go/os
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-21 07:03:38 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-21 07:03:38 +0000
commit79a796b7d3db5d100eedfc774954a6b44944363a (patch)
tree72455aea0286937aa08cc141e5efc800e4626577 /libgo/go/os
parent7224cf54b3af2b931fb83af65f9cfab5c1df814a (diff)
downloadgcc-79a796b7d3db5d100eedfc774954a6b44944363a.tar.gz
libgo: Update to current version of master library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193688 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/os')
-rw-r--r--libgo/go/os/dir_plan9.go4
-rw-r--r--libgo/go/os/doc.go2
-rw-r--r--libgo/go/os/error.go2
-rw-r--r--libgo/go/os/exec/exec.go2
-rw-r--r--libgo/go/os/file.go4
-rw-r--r--libgo/go/os/stat_plan9.go2
-rw-r--r--libgo/go/os/types.go6
-rw-r--r--libgo/go/os/user/lookup_unix.go2
8 files changed, 15 insertions, 9 deletions
diff --git a/libgo/go/os/dir_plan9.go b/libgo/go/os/dir_plan9.go
index ebce6d83d82..060c0b2e8f8 100644
--- a/libgo/go/os/dir_plan9.go
+++ b/libgo/go/os/dir_plan9.go
@@ -110,7 +110,7 @@ var nullDir = dir{
}
// Null assigns members of d with special "don't care" values indicating
-// they should not be written by syscall.Wstat.
+// they should not be written by syscall.Wstat.
func (d *dir) Null() {
*d = nullDir
}
@@ -118,7 +118,7 @@ func (d *dir) Null() {
// pdir appends a 9P Stat message based on the contents of Dir d to a byte slice b.
func pdir(b []byte, d *dir) []byte {
n := len(b)
- b = pbit16(b, 0) // length, filled in later
+ b = pbit16(b, 0) // length, filled in later
b = pbit16(b, d.Type)
b = pbit32(b, d.Dev)
b = pqid(b, d.Qid)
diff --git a/libgo/go/os/doc.go b/libgo/go/os/doc.go
index 6a531e0d74e..c469e585331 100644
--- a/libgo/go/os/doc.go
+++ b/libgo/go/os/doc.go
@@ -89,7 +89,7 @@ func Hostname() (name string, err error) {
}
// Readdir reads the contents of the directory associated with file and
-// returns an array of up to n FileInfo values, as would be returned
+// returns a slice of up to n FileInfo values, as would be returned
// by Lstat, in directory order. Subsequent calls on the same file will yield
// further FileInfos.
//
diff --git a/libgo/go/os/error.go b/libgo/go/os/error.go
index b88e49400de..a7977ff1914 100644
--- a/libgo/go/os/error.go
+++ b/libgo/go/os/error.go
@@ -43,7 +43,7 @@ func NewSyscallError(syscall string, err error) error {
return &SyscallError{syscall, err}
}
-// IsExist returns whether the error is known to report that a file or directory
+// IsExist returns whether the error is known to report that a file or directory
// already exists. It is satisfied by ErrExist as well as some syscall errors.
func IsExist(err error) bool {
return isExist(err)
diff --git a/libgo/go/os/exec/exec.go b/libgo/go/os/exec/exec.go
index c4907cd7d7b..8368491b0fe 100644
--- a/libgo/go/os/exec/exec.go
+++ b/libgo/go/os/exec/exec.go
@@ -37,7 +37,7 @@ type Cmd struct {
// Args holds command line arguments, including the command as Args[0].
// If the Args field is empty or nil, Run uses {Path}.
- //
+ //
// In typical use, both Path and Args are set by calling Command.
Args []string
diff --git a/libgo/go/os/file.go b/libgo/go/os/file.go
index 4acf35d6755..32cac6d89a4 100644
--- a/libgo/go/os/file.go
+++ b/libgo/go/os/file.go
@@ -9,7 +9,7 @@
// if a call that takes a file name fails, such as Open or Stat, the error
// will include the failing file name when printed and will be of type
// *PathError, which may be unpacked for more information.
-//
+//
// The os interface is intended to be uniform across all operating systems.
// Features not generally available appear in the system-specific package syscall.
//
@@ -185,7 +185,7 @@ func (f *File) Seek(offset int64, whence int) (ret int64, err error) {
}
// WriteString is like Write, but writes the contents of string s rather than
-// an array of bytes.
+// a slice of bytes.
func (f *File) WriteString(s string) (ret int, err error) {
if f == nil {
return 0, ErrInvalid
diff --git a/libgo/go/os/stat_plan9.go b/libgo/go/os/stat_plan9.go
index 1bc9dd0524a..b3dd1883433 100644
--- a/libgo/go/os/stat_plan9.go
+++ b/libgo/go/os/stat_plan9.go
@@ -38,7 +38,7 @@ func fileInfoFromStat(d *dir) FileInfo {
return fs
}
-// arg is an open *File or a path string.
+// arg is an open *File or a path string.
func dirstat(arg interface{}) (d *dir, err error) {
var name string
diff --git a/libgo/go/os/types.go b/libgo/go/os/types.go
index ecb57872d52..c561ea04fb8 100644
--- a/libgo/go/os/types.go
+++ b/libgo/go/os/types.go
@@ -88,6 +88,12 @@ func (m FileMode) IsDir() bool {
return m&ModeDir != 0
}
+// IsRegular reports whether m describes a regular file.
+// That is, it tests that no mode type bits are set.
+func (m FileMode) IsRegular() bool {
+ return m&ModeType == 0
+}
+
// Perm returns the Unix permission bits in m.
func (m FileMode) Perm() FileMode {
return m & ModePerm
diff --git a/libgo/go/os/user/lookup_unix.go b/libgo/go/os/user/lookup_unix.go
index 5c964082010..e0baae2dc48 100644
--- a/libgo/go/os/user/lookup_unix.go
+++ b/libgo/go/os/user/lookup_unix.go
@@ -44,7 +44,7 @@ func bytePtrToString(p *byte) string {
return string(a[:i])
}
-// Current returns the current user.
+// Current returns the current user.
func Current() (*User, error) {
return lookup(syscall.Getuid(), "", false)
}