Skip to content

Commit

Permalink
os,time: fix Plan 9 build
Browse files Browse the repository at this point in the history
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5689043
  • Loading branch information
fhs authored and robpike committed Feb 20, 2012
1 parent 7a4d744 commit 441538e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
13 changes: 13 additions & 0 deletions src/pkg/os/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ const (
SEEK_END int = 2 // seek relative to the end
)

// LinkError records an error during a link or symlink or rename
// system call and the paths that caused it.
type LinkError struct {
Op string
Old string
New string
Err error
}

func (e *LinkError) Error() string {
return e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error()
}

// Read reads up to len(b) bytes from the File.
// It returns the number of bytes read and an error, if any.
// EOF is signaled by a zero count with err set to io.EOF.
Expand Down
13 changes: 0 additions & 13 deletions src/pkg/os/file_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ func epipecheck(file *File, e error) {
}
}

// LinkError records an error during a link or symlink or rename
// system call and the paths that caused it.
type LinkError struct {
Op string
Old string
New string
Err error
}

func (e *LinkError) Error() string {
return e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error()
}

// Link creates newname as a hard link to the oldname file.
// If there is an error, it will be of type *LinkError.
func Link(oldname, newname string) error {
Expand Down
3 changes: 2 additions & 1 deletion src/pkg/time/sys_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func readFile(name string) ([]byte, error) {
}

func open(name string) (uintptr, error) {
fd, err := syscall.Open(name, syscall.O_RDONLY, 0)
fd, err := syscall.Open(name, syscall.O_RDONLY)
if err != nil {
return 0, err
}
Expand Down Expand Up @@ -72,4 +72,5 @@ func preadn(fd uintptr, buf []byte, off int) error {
}
buf = buf[m:]
}
return nil
}
5 changes: 2 additions & 3 deletions src/pkg/time/zoneinfo_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ package time

import (
"errors"
"runtime"
"syscall"
)

var badData = errors.New("malformed time zone information")

func isSpace(r rune) bool {
return r == ' ' || r == '\t' || r == '\n'
}
Expand Down Expand Up @@ -149,7 +148,7 @@ func initLocal() {
}

func loadLocation(name string) (*Location, error) {
if z, err := loadZoneFile(runtime.GOROOT() + "/lib/time/zoneinfo/" + name); err == nil {
if z, err := loadZoneFile(runtime.GOROOT()+"/lib/time/zoneinfo.zip", name); err == nil {
z.name = name
return z, nil
}
Expand Down

0 comments on commit 441538e

Please sign in to comment.