Skip to content

Commit

Permalink
fscommon.WriteFile: simplify error message
Browse files Browse the repository at this point in the history
As the underlying error message from iotuils.WriteFile already contains
file name, there's no need to put it, otherwise we end up with something
like:

	failed to write "val" to "/sys/fs/cgroup/.../file": open /sys/fs/cgroup/.../file: permission denied

With this patch, the error will be

	failed to write "val": open /sys/fs/cgroup/.../file: permission denied

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Sep 16, 2020
1 parent aea16cd commit 90fdf24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/cgroups/fscommon/fscommon.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func WriteFile(dir, file, data string) error {
return err
}
if err := retryingWriteFile(path, []byte(data), 0700); err != nil {
return errors.Wrapf(err, "failed to write %q to %q", data, path)
return errors.Wrapf(err, "failed to write %q", data)
}
return nil
}
Expand Down

0 comments on commit 90fdf24

Please sign in to comment.