changeset 113:1e7144176a42

Print a warning if we get an unexpected error trying to open a file.
author David A. Holland
date Tue, 11 Jun 2013 13:55:09 -0400
parents 2b0b61fd1a36
children 05d67dd74e1f
files files.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/files.c	Tue Jun 11 13:50:07 2013 -0400
+++ b/files.c	Tue Jun 11 13:55:09 2013 -0400
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <errno.h>
 #include <err.h>
 
 #include "array.h"
@@ -326,6 +327,9 @@
 
 	fd = open(file, O_RDONLY);
 	if (fd < 0) {
+		if (errno != ENOENT && errno != ENOTDIR) {
+			warn("%s", file);
+		}
 		return -1;
 	}