Vendor update gopacket and unix package
This commit is contained in:
1 parent
54d24e65ef
commit
43d3339b39
319 files changed
+91339
-13246
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
// +build !darwin,!arm,!windows,!mipsle,!mips,!386
|
||||
|
||||
package raw
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// newTimeval transforms a duration into a unix.Timeval struct.
|
||||
// An error is returned in case of zero time value.
|
||||
func newTimeval(timeout time.Duration) (*unix.Timeval, error) {
|
||||
if timeout < time.Microsecond {
|
||||
return nil, &timeoutError{}
|
||||
}
|
||||
return &unix.Timeval{
|
||||
Sec: int64(timeout / time.Second),
|
||||
Usec: int64(timeout % time.Second / time.Microsecond),
|
||||
}, nil
|
||||
}
|
||||
Reference in new issue
Block a user