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 75722890a53..3e0509deb9c 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 84463995d05..07da1080454 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 7f966152d6d..9c5f0febed6 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 1f0b3ee2850..52eebf559ed 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 9a74033ceab..19bf713de3a 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 9d7d4dc89dd..9423d246428 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 f44e62ce8cd..364dc5839c8 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 1e84033daff..6649b9f2dcc 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 b601abc75da..c8f4531923d 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 3c365db1479..d52e8ca7222 100644 --- a/main_solaris.go +++ b/main_solaris.go @@ -1,5 +1,3 @@ -// +build solaris - package main import "github.com/urfave/cli"