Skip to content

Commit

Permalink
errtracker: use a helper for checking whether snapd reexeced
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
  • Loading branch information
bboozzoo committed Jun 22, 2020
1 parent 3dc1ca5 commit edb5b48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions errtracker/errtracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/snapcore/snapd/osutil"
"github.com/snapcore/snapd/release"
"github.com/snapcore/snapd/snapdenv"
"github.com/snapcore/snapd/snapdtool"
)

var (
Expand Down Expand Up @@ -216,12 +217,11 @@ func snapConfineProfileDigest(suffix string) string {
}

var didSnapdReExec = func() string {
// TODO: move this into osutil.Reexeced() ?
exe, err := os.Readlink(procSelfExe)
didReexec, err := snapdtool.IsReexecd()
if err != nil {
return "unknown"
}
if strings.HasPrefix(exe, dirs.SnapMountDir) {
if didReexec {
return "yes"
}
return "no"
Expand Down

0 comments on commit edb5b48

Please sign in to comment.