diff files.c @ 143:ed45f2d8d3bc

Don't use the <err.h> functions. There are still people out there using legacy systems that are missing them.
author David A. Holland
date Sat, 13 Jul 2013 12:47:20 -0400
parents 1cda505ddc78
children a2c2fe8dbea3 d6e6b3940780
line wrap: on
line diff
--- a/files.c	Sat Jul 13 12:38:54 2013 -0400
+++ b/files.c	Sat Jul 13 12:47:20 2013 -0400
@@ -34,7 +34,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <err.h>
 
 #include "array.h"
 #include "mode.h"
@@ -214,7 +213,8 @@
 
 			if (result == -1) {
 				/* read error */
-				warn("%s", name);
+				complain(NULL, "%s: %s",
+					 name, strerror(errno));
 				complain_fail();
 			} else if (result == 0 && bufend == linestart) {
 				/* eof */
@@ -332,7 +332,7 @@
 	fd = open(file, O_RDONLY);
 	if (fd < 0) {
 		if (errno != ENOENT && errno != ENOTDIR) {
-			warn("%s", file);
+			complain(NULL, "%s: %s", file, strerror(errno));
 		}
 		return -1;
 	}
@@ -406,7 +406,7 @@
 	} else {
 		fd = file_tryopen(name);
 		if (fd < 0) {
-			warn("%s", name);
+			complain(NULL, "%s: %s", name, strerror(errno));
 			die();
 		}
 		pf = place_addfile(place, name, false);