mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
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. [ Linux commit : 46fe94ad18aa7ce6b3dad8c035fb538942020f2b ] Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Michal Marek <mmarek@suse.com>
This commit is contained in:
parent
c409bd015c
commit
c1420f8b2b
1 changed files with 5 additions and 1 deletions
|
@ -296,7 +296,11 @@ static void do_config_file(const char *filename)
|
|||
perror(filename);
|
||||
exit(2);
|
||||
}
|
||||
fstat(fd, &st);
|
||||
if (fstat(fd, &st) < 0) {
|
||||
fprintf(stderr, "fixdep: error fstat'ing config file: ");
|
||||
perror(filename);
|
||||
exit(2);
|
||||
}
|
||||
if (st.st_size == 0) {
|
||||
close(fd);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue