From 4c673602964ed3be8b96023ed5a2e0cd9a7ecdf3 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Fri, 12 May 2017 17:22:09 +0100 Subject: [PATCH] Clean up unix vs linux usage FreeBSD does not support cgroups or namespaces, which the code suggested, and is not supported in runc anyway right now. So clean up the file naming to use `_linux` where appropriate. Signed-off-by: Justin Cormack --- libcontainer/configs/{cgroup_unix.go => cgroup_linux.go} | 2 -- libcontainer/configs/{config_unix.go => config_linux.go} | 2 -- .../configs/{config_unix_test.go => config_linux_test.go} | 2 -- .../configs/{namespaces_unix.go => namespaces_linux.go} | 2 -- libcontainer/configs/namespaces_unsupported.go | 2 +- libcontainer/{criu_opts_unix.go => criu_opts_linux.go} | 2 -- libcontainer/devices/{devices_unix.go => devices_linux.go} | 2 -- libcontainer/devices/devices_unsupported.go | 2 +- main_unix.go => main_linux.go | 2 -- main_solaris.go | 2 -- 10 files changed, 2 insertions(+), 18 deletions(-) rename libcontainer/configs/{cgroup_unix.go => cgroup_linux.go} (99%) rename libcontainer/configs/{config_unix.go => config_linux.go} (98%) rename libcontainer/configs/{config_unix_test.go => config_linux_test.go} (98%) rename libcontainer/configs/{namespaces_unix.go => namespaces_linux.go} (98%) rename libcontainer/{criu_opts_unix.go => criu_opts_linux.go} (98%) rename libcontainer/devices/{devices_unix.go => devices_linux.go} (98%) rename main_unix.go => main_linux.go (97%) diff --git a/libcontainer/configs/cgroup_unix.go b/libcontainer/configs/cgroup_linux.go similarity index 99% rename from libcontainer/configs/cgroup_unix.go rename to libcontainer/configs/cgroup_linux.go index 75722890..3e0509de 100644 --- a/libcontainer/configs/cgroup_unix.go +++ b/libcontainer/configs/cgroup_linux.go @@ -1,5 +1,3 @@ -// +build linux freebsd - package configs type FreezerState string diff --git a/libcontainer/configs/config_unix.go b/libcontainer/configs/config_linux.go similarity index 98% rename from libcontainer/configs/config_unix.go rename to libcontainer/configs/config_linux.go index 84463995..07da1080 100644 --- a/libcontainer/configs/config_unix.go +++ b/libcontainer/configs/config_linux.go @@ -1,5 +1,3 @@ -// +build freebsd linux - package configs import "fmt" diff --git a/libcontainer/configs/config_unix_test.go b/libcontainer/configs/config_linux_test.go similarity index 98% rename from libcontainer/configs/config_unix_test.go rename to libcontainer/configs/config_linux_test.go index 7f966152..9c5f0feb 100644 --- a/libcontainer/configs/config_unix_test.go +++ b/libcontainer/configs/config_linux_test.go @@ -1,5 +1,3 @@ -// +build linux freebsd - package configs import ( diff --git a/libcontainer/configs/namespaces_unix.go b/libcontainer/configs/namespaces_linux.go similarity index 98% rename from libcontainer/configs/namespaces_unix.go rename to libcontainer/configs/namespaces_linux.go index 1f0b3ee2..52eebf55 100644 --- a/libcontainer/configs/namespaces_unix.go +++ b/libcontainer/configs/namespaces_linux.go @@ -1,5 +1,3 @@ -// +build linux freebsd - package configs import ( diff --git a/libcontainer/configs/namespaces_unsupported.go b/libcontainer/configs/namespaces_unsupported.go index 9a74033c..19bf713d 100644 --- a/libcontainer/configs/namespaces_unsupported.go +++ b/libcontainer/configs/namespaces_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux,!freebsd +// +build !linux package configs diff --git a/libcontainer/criu_opts_unix.go b/libcontainer/criu_opts_linux.go similarity index 98% rename from libcontainer/criu_opts_unix.go rename to libcontainer/criu_opts_linux.go index 9d7d4dc8..9423d246 100644 --- a/libcontainer/criu_opts_unix.go +++ b/libcontainer/criu_opts_linux.go @@ -1,5 +1,3 @@ -// +build linux freebsd - package libcontainer // cgroup restoring strategy provided by criu diff --git a/libcontainer/devices/devices_unix.go b/libcontainer/devices/devices_linux.go similarity index 98% rename from libcontainer/devices/devices_unix.go rename to libcontainer/devices/devices_linux.go index f44e62ce..364dc583 100644 --- a/libcontainer/devices/devices_unix.go +++ b/libcontainer/devices/devices_linux.go @@ -1,5 +1,3 @@ -// +build linux freebsd - package devices import ( diff --git a/libcontainer/devices/devices_unsupported.go b/libcontainer/devices/devices_unsupported.go index 1e84033d..6649b9f2 100644 --- a/libcontainer/devices/devices_unsupported.go +++ b/libcontainer/devices/devices_unsupported.go @@ -1,3 +1,3 @@ -// +build windows +// +build !linux package devices diff --git a/main_unix.go b/main_linux.go similarity index 97% rename from main_unix.go rename to main_linux.go index b601abc7..c8f45319 100644 --- a/main_unix.go +++ b/main_linux.go @@ -1,5 +1,3 @@ -// +build linux - package main import ( diff --git a/main_solaris.go b/main_solaris.go index 3c365db1..d52e8ca7 100644 --- a/main_solaris.go +++ b/main_solaris.go @@ -1,5 +1,3 @@ -// +build solaris - package main import "github.com/urfave/cli"