New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conf: avoid spawning unnecessary subshells #2022
Conversation
This pull request didn't trigger Jenkins as its author isn't in the whitelist. An organization member must perform one of the following:
Those commands are simple Github comments of the format: "jenkins: COMMAND" |
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
I don't see obvious reasons to nack it. :) @stgraber? |
jenkins: test this please |
@@ -355,10 +355,11 @@ static int run_script_argv(const char *name, const char *section, | |||
|
|||
size += strlen(hook) + 1; | |||
|
|||
size += strlen("exec"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That escaped me that should be a static sizeof("exec")
. Fixing this in #2026 since I need to touch that code anyway. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use sizeof
instead, it should be sizeof("exec") - 1
. The compiler should be smart enough to do the right thing though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use sizeof instead, it should be sizeof("exec") - 1.
No, not really I'm just leaveing it as sizeof("exec")
since this automatically accounts for the added ' '
. In my branch I'm doing a size++
after each strlen()
. In this case I'm just going to leave the sizeof()
and not do a size++
. But feel free to comment on the #2026. :)
The compiler should be smart enough to do the right thing though
Yeah, I agree but I like the code to reflect that this is information that is available statically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, cleaner indeed ;)
Signed-off-by: Jonathan Calmels jcalmels@nvidia.com
I'm not sure about the implications of this, this should be fine but @brauner might know better :)