* [PATCH] Make fixdep error handling more explicit
@ 2010-12-22 18:30 Ben Gamari
2010-12-22 22:24 ` Michal Marek
0 siblings, 1 reply; 2+ messages in thread
From: Ben Gamari @ 2010-12-22 18:30 UTC (permalink / raw)
To: linux-kbuild; +Cc: Ben Gamari
Also add missing error handling to fstat call
Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
---
scripts/basic/fixdep.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index ea26b23..184fb89 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -273,7 +273,7 @@ static void do_config_file(char *filename)
fd = open(filename, O_RDONLY);
if (fd < 0) {
- fprintf(stderr, "fixdep: ");
+ fprintf(stderr, "fixdep: error opening config file: ");
perror(filename);
exit(2);
}
@@ -344,11 +344,15 @@ static void print_deps(void)
fd = open(depfile, O_RDONLY);
if (fd < 0) {
- fprintf(stderr, "fixdep: ");
+ fprintf(stderr, "fixdep: error opening depfile: ");
perror(depfile);
exit(2);
}
- fstat(fd, &st);
+ if (fstat(fd, &st) < 0) {
+ fprintf(stderr, "fixdep: error fstat'ing depfile: ");
+ perror(depfile);
+ exit(2);
+ }
if (st.st_size == 0) {
fprintf(stderr,"fixdep: %s is empty\n",depfile);
close(fd);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Make fixdep error handling more explicit
2010-12-22 18:30 [PATCH] Make fixdep error handling more explicit Ben Gamari
@ 2010-12-22 22:24 ` Michal Marek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2010-12-22 22:24 UTC (permalink / raw)
To: Ben Gamari; +Cc: linux-kbuild
On Wed, Dec 22, 2010 at 01:30:14PM -0500, Ben Gamari wrote:
> Also add missing error handling to fstat call
>
> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
> ---
> scripts/basic/fixdep.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
Applied to kbuild-2.6.git#kbuild, thanks.
Michal
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-22 22:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22 18:30 [PATCH] Make fixdep error handling more explicit Ben Gamari
2010-12-22 22:24 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox