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_amd64.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/syscall/syscall_linux_amd64.go') diff --git a/src/syscall/syscall_linux_amd64.go b/src/syscall/syscall_linux_amd64.go index 119204b70b..faa973dbdf 100644 --- a/src/syscall/syscall_linux_amd64.go +++ b/src/syscall/syscall_linux_amd64.go @@ -84,16 +84,12 @@ func Time(t *Time_t) (tt Time_t, err error) { return Time_t(tv.Sec), nil } -func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } - func NsecToTimespec(nsec int64) (ts Timespec) { ts.Sec = nsec / 1e9 ts.Nsec = 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 = nsec / 1e9 -- cgit v1.3-5-g9baa