Skip to content

Commit

Permalink
cmd/util: rename OS specific files
Browse files Browse the repository at this point in the history
Update file names based on their GOOS, allowing the removal of the
explicit build constraint, `// +build`, calls. Additionally, this patch
rename the _darwin specific file to _bsd, to allow future addition of BSD
systems.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
  • Loading branch information
bmeneg committed May 20, 2021
1 parent f1a6b7d commit 5f745da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmd/util_darwin.go → cmd/util_bsd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file contains Darwin (MacOS) specific calls.
// This file contains Darwin (MacOS) and *BSD specific calls.

// +build darwin

Expand All @@ -8,8 +8,8 @@ package cmd
// 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 5f745da

Please sign in to comment.