libct/cgroups/fscommon: nits#2604
Merged
Merged
Conversation
4 tasks
AkihiroSuda
previously approved these changes
Sep 29, 2020
thaJeztah
requested changes
Sep 29, 2020
Member
thaJeztah
left a comment
There was a problem hiding this comment.
one nit in the first commit, LGTM otherwise
thaJeztah
reviewed
Sep 29, 2020
1. Don't wrap the error from fscommon.GetCgroupParamUint as it already contains the file name. 2. Don't put file name when wrapping the error from ioutil.ReadFile since it already has it. 3. Don't reconstruct file name, use existing one since it's available. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2. Fix wrapping the error to not have the value as it's already part of the error returned from ParseUint. 3. Fix/improve doc. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. Use own ReadFile wrapper instead of ioutils.ReadFile. This makes it use the security measures of ReadFile. 2. Improve doc. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. Use GetCgroupParamString as the initial part of both functions are the same and we can reuse it. This also gives us whatever security measures GetCgroupParamString has (see previous commit). 2. Fix the error wrapping to not add the value, as it is already a part of the error returned by ParseUint. 3. Improve docstring. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Document ReadFile and WriteFile. Fix doc for ParseUint to be in canonical form. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
f0d3a88 to
6c83d23
Compare
Contributor
Author
AkihiroSuda
approved these changes
Sep 29, 2020
Member
mrunalp
approved these changes
Sep 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is mostly error message fixes, doc improvements, and other minor cleanups.
This used to be a part of #2598