Skip to content

Commit

Permalink
use unix.SysctlTimeval to get boot time
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkroh committed Apr 10, 2024
1 parent ff57aec commit 496d742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build freebsd && cgo
//go:build freebsd

package freebsd

Expand All @@ -29,8 +29,8 @@ import (
const kernBoottimeMIB = "kern.boottime"

func BootTime() (time.Time, error) {
var tv unix.Timeval
if err := sysctlByName(kernBoottimeMIB, &tv); err != nil {
tv, err := unix.SysctlTimeval(kernBoottimeMIB)
if err != nil {
return time.Time{}, fmt.Errorf("failed to get host uptime: %w", err)
}

Expand Down
File renamed without changes.

0 comments on commit 496d742

Please sign in to comment.