aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/basic/fixdep.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 1ae25c919..47a0cee07 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -107,6 +107,7 @@
107#ifndef __MINGW32__ 107#ifndef __MINGW32__
108#include <sys/mman.h> 108#include <sys/mman.h>
109#endif 109#endif
110#include <errno.h>
110#include <unistd.h> 111#include <unistd.h>
111#include <fcntl.h> 112#include <fcntl.h>
112#include <string.h> 113#include <string.h>
@@ -347,7 +348,10 @@ void do_config_file(char *filename)
347 perror(filename); 348 perror(filename);
348 exit(2); 349 exit(2);
349 } 350 }
350 fstat(fd, &st); 351 if (fstat(fd, &st) < 0) {
352 fprintf(stderr, "fixdep: fstat %s %s\n", filename, strerror(errno));
353 exit(2);
354 }
351 if (st.st_size == 0) { 355 if (st.st_size == 0) {
352 close(fd); 356 close(fd);
353 return; 357 return;
@@ -425,7 +429,10 @@ void print_deps(void)
425 perror(depfile); 429 perror(depfile);
426 exit(2); 430 exit(2);
427 } 431 }
428 fstat(fd, &st); 432 if (fstat(fd, &st) < 0) {
433 fprintf(stderr, "fixdep: fstat %s %s\n", depfile, strerror(errno));
434 exit(2);
435 }
429 if (st.st_size == 0) { 436 if (st.st_size == 0) {
430 fprintf(stderr,"fixdep: %s is empty\n",depfile); 437 fprintf(stderr,"fixdep: %s is empty\n",depfile);
431 close(fd); 438 close(fd);