Skip to content

Commit

Permalink
Merge pull request opencontainers#653 from jfrazelle/remove-deadcode
Browse files Browse the repository at this point in the history
remove deadcode
  • Loading branch information
Mrunal Patel committed Mar 17, 2016
2 parents 541725b + 2c5b101 commit 62470e0
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 47 deletions.
10 changes: 0 additions & 10 deletions libcontainer/cgroups/systemd/apply_systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 1 addition & 11 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/integration/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 1 addition & 2 deletions libcontainer/label/label_selinux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 0 additions & 4 deletions main_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ var (
specCommand cli.Command
killCommand cli.Command
)

func runAction(*cli.Context) {
fatalf("Current OS is not supported yet")
}
10 changes: 0 additions & 10 deletions tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 0 additions & 9 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 62470e0

Please sign in to comment.