aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/basic
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-12-07 16:26:08 -0500
committerMichal Marek <mmarek@suse.com>2016-02-17 16:52:04 -0500
commit46fe94ad18aa7ce6b3dad8c035fb538942020f2b (patch)
treeef7acb440291f285efdb6dc910aec8c1abf1db70 /scripts/basic
parenta043934207c5eb271deeaed2e9bd019c3be92cad (diff)
kbuild: fixdep: Check fstat(2) return value
Coverity has recently added a check that will find when we don't check the return code from fstat(2). Copy/paste the checking logic that print_deps() has with an appropriate re-wording of the perror() message. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts/basic')
-rw-r--r--scripts/basic/fixdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 5b327c67a828..caef815d1743 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -274,7 +274,11 @@ static void do_config_file(const char *filename)
274 perror(filename); 274 perror(filename);
275 exit(2); 275 exit(2);
276 } 276 }
277 fstat(fd, &st); 277 if (fstat(fd, &st) < 0) {
278 fprintf(stderr, "fixdep: error fstat'ing config file: ");
279 perror(filename);
280 exit(2);
281 }
278 if (st.st_size == 0) { 282 if (st.st_size == 0) {
279 close(fd); 283 close(fd);
280 return; 284 return;