Skip to content

Commit

Permalink
Fix ping() on NetBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Oct 25, 2024
1 parent 386f369 commit e324599
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/ping-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ ping_os <- function(destination, continuous, count, timeout) {
destination
)

} else if (Sys.info()[["sysname"]] == "NetBSD") {
cmd <- c(
"ping",
# on NetBSD -w is a total timeout, so adjust it
"-w", if (continuous) int(timeout) else count * int(timeout),
if (!continuous) c("-c", count),
destination
)

} else if (.Platform$OS.type == "unix") {
cmd <- c(
"ping",
Expand Down

0 comments on commit e324599

Please sign in to comment.