summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-04-19 12:42:40 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-04-19 12:42:40 +0000
commit684c1eb2c9b075fe6f3e0bb61ea2fa95fc166a9a (patch)
tree691e57bb39c143d3460b8733d2636b16e7618ba0
parentd16d8fd4457a6231c6a0863b3065004aba4c60b3 (diff)
error checking for readdir(2); ok gilles@
-rw-r--r--usr.sbin/smtpd/queue_shared.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/queue_shared.c b/usr.sbin/smtpd/queue_shared.c
index 7f0c6478fe5..330b95ad4fd 100644
--- a/usr.sbin/smtpd/queue_shared.c
+++ b/usr.sbin/smtpd/queue_shared.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue_shared.c,v 1.16 2009/04/12 12:33:43 gilles Exp $ */
+/* $OpenBSD: queue_shared.c,v 1.17 2009/04/19 12:42:39 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -560,7 +560,10 @@ qwalk(struct qwalk *q, char *filepath)
struct dirent *dp;
again:
+ errno = 0;
dp = readdir(q->dirs[q->level]);
+ if (errno)
+ fatal("qwalk: readdir");
if (dp == NULL) {
closedir(q->dirs[q->level]);
q->dirs[q->level] = NULL;