Skip to content

Commit

Permalink
Merge pull request #262 from dcantah/cg2-noretry-eintr
Browse files Browse the repository at this point in the history
cgroup2: Don't retry on EINTR
  • Loading branch information
AkihiroSuda authored Dec 31, 2022
2 parents dd9a65f + 2b3be83 commit e91481e
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions cgroup2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,11 @@ func (c *Value) write(path string, perm os.FileMode) error {
return ErrInvalidFormat
}

// Retry writes on EINTR; see:
// https://github.com/golang/go/issues/38033
for {
err := os.WriteFile(
filepath.Join(path, c.filename),
data,
perm,
)
if err == nil {
return nil
} else if !errors.Is(err, syscall.EINTR) {
return err
}
}
return os.WriteFile(
filepath.Join(path, c.filename),
data,
perm,
)
}

func writeValues(path string, values []Value) error {
Expand Down

0 comments on commit e91481e

Please sign in to comment.