Skip to content

Commit

Permalink
Merge pull request #682 from bmeneguele/fix-bsd
Browse files Browse the repository at this point in the history
Fix build for BSD OSes family
  • Loading branch information
bmeneg authored May 20, 2021
2 parents f1a6b7d + f63883f commit df276a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cmd/util_darwin.go → cmd/util_bsd.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// This file contains Darwin (MacOS) specific calls.
// This file contains Darwin (MacOS) and *BSD specific calls.

// +build darwin
// +build freebsd openbsd dragonfly darwin

package cmd

// Unfortunatelly MacOS don't have the DUP3() system call, which is forced
// by Linux ARM64 not having the DUP2() anymore. With that, we need to
// repeat the other code and func declarations that are the same.

// FIXME: there MUST be some better way to do that... only dupFD2() should be
// here.
// FIXME: there MUST be some better way to do that... only dupFD2() should
// be here.

import "syscall"

Expand Down
7 changes: 2 additions & 5 deletions cmd/util_unix.go → cmd/util_linux.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// This file contains Linux specific calls.

// +build !windows,!darwin

package cmd

// Since we're using some system calls that are platform-specific, we need
// to make sure we have a small layer of compatibility for Unix-like and
// Windows operating systems. For now, this file is still valid for BSDs
// (MacOS NOT included)
// to make sure we have a small layer of compatibility for Linux, Windows
// and *BSD operating systems.

import "syscall"

Expand Down
2 changes: 0 additions & 2 deletions cmd/util_windows.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// This file contains Windows specific calls.

// +build windows

package cmd

// Even though Windows has a POSIX layer, it's implemented in userspace and,
Expand Down

0 comments on commit df276a8

Please sign in to comment.