From 7f6eadb64fb16e73b15630dd3089edc568d047cb Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 11 Oct 2016 14:20:50 -0700 Subject: syscall: unify TimespecToNsec and TimevalToNsec All implementations of these functions are identical. Change-Id: I7cbea53c02bb0cee75e30beed19d29ba0a7ef657 Reviewed-on: https://go-review.googlesource.com/30819 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/syscall/syscall_linux_386.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/syscall/syscall_linux_386.go') diff --git a/src/syscall/syscall_linux_386.go b/src/syscall/syscall_linux_386.go index 4f3c7c440a..b7b84b1c34 100644 --- a/src/syscall/syscall_linux_386.go +++ b/src/syscall/syscall_linux_386.go @@ -14,16 +14,12 @@ const ( _SYS_getdents = SYS_GETDENTS64 ) -func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } - func NsecToTimespec(nsec int64) (ts Timespec) { ts.Sec = int32(nsec / 1e9) ts.Nsec = int32(nsec % 1e9) return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Sec = int32(nsec / 1e9) -- cgit v1.3-6-g1900