diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fbuilder/build_profile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fbuilder/build_profile.c b/src/fbuilder/build_profile.c index 0517c837e..09f41a838 100644 --- a/src/fbuilder/build_profile.c +++ b/src/fbuilder/build_profile.c | |||
@@ -85,12 +85,12 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
85 | int have_yama_permission = 1; | 85 | int have_yama_permission = 1; |
86 | if (access("/usr/bin/strace", X_OK) == 0) { | 86 | if (access("/usr/bin/strace", X_OK) == 0) { |
87 | have_strace = 1; | 87 | have_strace = 1; |
88 | FILE *fp = fopen("/proc/sys/kernel/yama/ptrace_scope", "r"); | 88 | FILE *ps = fopen("/proc/sys/kernel/yama/ptrace_scope", "r"); |
89 | if (fp) { | 89 | if (ps) { |
90 | unsigned val; | 90 | unsigned val; |
91 | if (fscanf(fp, "%u", &val) == 1) | 91 | if (fscanf(ps, "%u", &val) == 1) |
92 | have_yama_permission = (val < 2); | 92 | have_yama_permission = (val < 2); |
93 | fclose(fp); | 93 | fclose(ps); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
@@ -102,10 +102,10 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
102 | cmd[0] = cmdlist[0]; // explicit assignment to clean scan-build error | 102 | cmd[0] = cmdlist[0]; // explicit assignment to clean scan-build error |
103 | 103 | ||
104 | // build command | 104 | // build command |
105 | // skip strace if not installed, or no permission to use it | ||
105 | int skip_strace = !(have_strace && have_yama_permission); | 106 | int skip_strace = !(have_strace && have_yama_permission); |
106 | unsigned i = 0; | 107 | unsigned i = 0; |
107 | for (i = 0; i < (int) sizeof(cmdlist) / sizeof(char*); i++) { | 108 | for (i = 0; i < (int) sizeof(cmdlist) / sizeof(char*); i++) { |
108 | // skip strace if not installed, or no permission to use it | ||
109 | if (skip_strace && strcmp(cmdlist[i], "/usr/bin/strace") == 0) | 109 | if (skip_strace && strcmp(cmdlist[i], "/usr/bin/strace") == 0) |
110 | break; | 110 | break; |
111 | cmd[i] = cmdlist[i]; | 111 | cmd[i] = cmdlist[i]; |