]> Cypherpunks repositories - gostls13.git/commitdiff
os,time: fix Plan 9 build
authorFazlul Shahriar <fshahriar@gmail.com>
Mon, 20 Feb 2012 01:31:24 +0000 (12:31 +1100)
committerRob Pike <r@golang.org>
Mon, 20 Feb 2012 01:31:24 +0000 (12:31 +1100)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5689043

src/pkg/os/file.go
src/pkg/os/file_posix.go
src/pkg/time/sys_plan9.go
src/pkg/time/zoneinfo_plan9.go

index ddcaa6fed9fb63c4bc2099bfee17c3e49cbb815d..1c3d0172d3433c0021b0bfa246d969f340f13a97 100644 (file)
@@ -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.
index 2ffc2ee083983a261457abe68bcb2c4aa7faecc1..073bd56a471d4bb21b1f7dc55620c11ac8565cf5 100644 (file)
@@ -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 {
index e2f91bccb56a13eb595b11fd5af8024a185628b1..8484729448eb96ec155e4942b8e69f8dcf8d050c 100644 (file)
@@ -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
        }
@@ -72,4 +72,5 @@ func preadn(fd uintptr, buf []byte, off int) error {
                }
                buf = buf[m:]
        }
+       return nil
 }
index 0fc2c25c0bafe43498e825b9f1c0de69354b55bd..6855238dc84f0b4c2456b93d066fd5dc14504b1a 100644 (file)
@@ -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'
 }
@@ -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
        }