diff --git a/libcontainer/cgroups/systemd/apply_systemd.go b/libcontainer/cgroups/systemd/apply_systemd.go index ad2ab028..b6158095 100644 --- a/libcontainer/cgroups/systemd/apply_systemd.go +++ b/libcontainer/cgroups/systemd/apply_systemd.go @@ -150,16 +150,6 @@ func UseSystemd() bool { return hasStartTransientUnit } -func getIfaceForUnit(unitName string) string { - if strings.HasSuffix(unitName, ".scope") { - return "Scope" - } - if strings.HasSuffix(unitName, ".service") { - return "Service" - } - return "Unit" -} - func (m *Manager) Apply(pid int) error { var ( c = m.Cgroups diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index 29bf1b8c..7d39b788 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -407,16 +407,6 @@ func (c *linuxContainer) NotifyMemoryPressure(level PressureLevel) (<-chan struc return notifyMemoryPressure(c.cgroupManager.GetPaths(), level) } -// XXX debug support, remove when debugging done. -func addArgsFromEnv(evar string, args *[]string) { - if e := os.Getenv(evar); e != "" { - for _, f := range strings.Fields(e) { - *args = append(*args, f) - } - } - fmt.Printf(">>> criu %v\n", *args) -} - // check Criu version greater than or equal to min_version func (c *linuxContainer) checkCriuVersion(min_version string) error { var x, y, z, versionReq int @@ -881,7 +871,7 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts * if err != nil { return err } - n, err = criuClient.Write(data) + _, err = criuClient.Write(data) if err != nil { return err } diff --git a/libcontainer/integration/exec_test.go b/libcontainer/integration/exec_test.go index 22a9afbf..453843de 100644 --- a/libcontainer/integration/exec_test.go +++ b/libcontainer/integration/exec_test.go @@ -590,7 +590,7 @@ func testPids(t *testing.T, systemd bool) { // Enforce a restrictive limit. 64 * /bin/true + 1 * shell should cause this // to fail reliabily. config.Cgroups.Resources.PidsLimit = 64 - out, ret, err := runContainer(config, "", "/bin/sh", "-c", ` + out, _, err := runContainer(config, "", "/bin/sh", "-c", ` /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true | diff --git a/libcontainer/label/label_selinux_test.go b/libcontainer/label/label_selinux_test.go index c2a19f5b..aab89a8b 100644 --- a/libcontainer/label/label_selinux_test.go +++ b/libcontainer/label/label_selinux_test.go @@ -41,8 +41,7 @@ func TestInit(t *testing.T) { } testBadData := []string{"user", "role:user_r", "type:user_t", "level:s0:c1,c15"} - plabel, mlabel, err = InitLabels(testBadData) - if err == nil { + if _, _, err = InitLabels(testBadData); err == nil { t.Log("InitLabels Bad Failed") t.Fatal(err) } diff --git a/main_unsupported.go b/main_unsupported.go index 3a83f4c1..32ce1ac9 100644 --- a/main_unsupported.go +++ b/main_unsupported.go @@ -11,7 +11,3 @@ var ( specCommand cli.Command killCommand cli.Command ) - -func runAction(*cli.Context) { - fatalf("Current OS is not supported yet") -} diff --git a/tty.go b/tty.go index fd531068..80c65515 100644 --- a/tty.go +++ b/tty.go @@ -12,16 +12,6 @@ import ( "github.com/opencontainers/runc/libcontainer" ) -// newTty creates a new tty for use with the container. If a tty is not to be -// created for the process, pipes are created so that the TTY of the parent -// process are not inherited by the container. -func newTty(create bool, p *libcontainer.Process, rootuid int, console string) (*tty, error) { - if create { - return createTty(p, rootuid, console) - } - return createStdioPipes(p, rootuid) -} - // setup standard pipes so that the TTY of the calling runc process // is not inherited by the container. func createStdioPipes(p *libcontainer.Process, rootuid int) (*tty, error) { diff --git a/utils.go b/utils.go index 325038d6..e39bad52 100644 --- a/utils.go +++ b/utils.go @@ -139,15 +139,6 @@ var ( var container libcontainer.Container -func containerPreload(context *cli.Context) error { - c, err := getContainer(context) - if err != nil { - return err - } - container = c - return nil -} - // loadFactory returns the configured factory instance for execing containers. func loadFactory(context *cli.Context) (libcontainer.Factory, error) { root := context.GlobalString("root")