diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-08-14 12:06:09 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-15 11:40:30 +0000 |
commit | e2b96e96f93d1da17b817eaa960b9d809bc61a14 (patch) | |
tree | 9dbf734f5f2021889666da7a738792635f2bf520 /vendor/github.com/projectatomic/buildah/unshare | |
parent | cd7102a70e7f3555df832c4c1bcf958e121cbf4d (diff) | |
download | podman-e2b96e96f93d1da17b817eaa960b9d809bc61a14.tar.gz podman-e2b96e96f93d1da17b817eaa960b9d809bc61a14.tar.bz2 podman-e2b96e96f93d1da17b817eaa960b9d809bc61a14.zip |
vendor: update buildah version
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1269
Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/unshare')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/unshare/unshare.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/vendor/github.com/projectatomic/buildah/unshare/unshare.go b/vendor/github.com/projectatomic/buildah/unshare/unshare.go index ed2a97934..4eea74956 100644 --- a/vendor/github.com/projectatomic/buildah/unshare/unshare.go +++ b/vendor/github.com/projectatomic/buildah/unshare/unshare.go @@ -33,7 +33,7 @@ type Cmd struct { Setsid bool Setpgrp bool Ctty *os.File - OOMScoreAdj int + OOMScoreAdj *int Hook func(pid int) error } @@ -234,18 +234,18 @@ func (c *Cmd) Start() error { } } - // Adjust the process's OOM score. - oomScoreAdj, err := os.OpenFile(fmt.Sprintf("/proc/%s/oom_score_adj", pidString), os.O_TRUNC|os.O_WRONLY, 0) - if err != nil { - fmt.Fprintf(continueWrite, "error opening oom_score_adj: %v", err) - return errors.Wrapf(err, "error opening /proc/%s/oom_score_adj", pidString) - } - if _, err := fmt.Fprintf(oomScoreAdj, "%d\n", c.OOMScoreAdj); err != nil { - fmt.Fprintf(continueWrite, "error writing \"%d\" to oom_score_adj: %v", c.OOMScoreAdj, err) - return errors.Wrapf(err, "error writing \"%d\" to /proc/%s/oom_score_adj", c.OOMScoreAdj, pidString) + if c.OOMScoreAdj != nil { + oomScoreAdj, err := os.OpenFile(fmt.Sprintf("/proc/%s/oom_score_adj", pidString), os.O_TRUNC|os.O_WRONLY, 0) + if err != nil { + fmt.Fprintf(continueWrite, "error opening oom_score_adj: %v", err) + return errors.Wrapf(err, "error opening /proc/%s/oom_score_adj", pidString) + } + defer oomScoreAdj.Close() + if _, err := fmt.Fprintf(oomScoreAdj, "%d\n", *c.OOMScoreAdj); err != nil { + fmt.Fprintf(continueWrite, "error writing \"%d\" to oom_score_adj: %v", c.OOMScoreAdj, err) + return errors.Wrapf(err, "error writing \"%d\" to /proc/%s/oom_score_adj", c.OOMScoreAdj, pidString) + } } - defer oomScoreAdj.Close() - // Run any additional setup that we want to do before the child starts running proper. if c.Hook != nil { if err = c.Hook(pid); err != nil { |