mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
refact: refactored to use islazy and updated deps
This commit is contained in:
parent
a2b3ee79fb
commit
d070445225
238 changed files with 12662 additions and 1586 deletions
20
vendor/github.com/mdlayher/raw/timeval.go
generated
vendored
Normal file
20
vendor/github.com/mdlayher/raw/timeval.go
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
// +build !darwin,!arm,!windows,!mipsle,!mips
|
||||
|
||||
package raw
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
// newTimeval transforms a duration into a syscall.Timeval struct.
|
||||
// An error is returned in case of zero time value.
|
||||
func newTimeval(timeout time.Duration) (*syscall.Timeval, error) {
|
||||
if timeout < time.Microsecond {
|
||||
return nil, &timeoutError{}
|
||||
}
|
||||
return &syscall.Timeval{
|
||||
Sec: int64(timeout / time.Second),
|
||||
Usec: int64(timeout % time.Second / time.Microsecond),
|
||||
}, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue