summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-02-19 22:02:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-02-19 22:02:16 +0000
commit3eb9b7bec3f734c81d6d8d3cb497acb1c698f79c (patch)
tree563ca8cb35ea1df0b128fea1092c819ca36710e1 /sys/arch
parente6535680fffbc32846e8926937a8df56cfc6f630 (diff)
Don't try to close(-1) if EPERM.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/stand/boot/boot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/alpha/stand/boot/boot.c b/sys/arch/alpha/stand/boot/boot.c
index acc6356cd4f..132d8e2d13e 100644
--- a/sys/arch/alpha/stand/boot/boot.c
+++ b/sys/arch/alpha/stand/boot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.22 2014/02/19 20:52:57 miod Exp $ */
+/* $OpenBSD: boot.c,v 1.23 2014/02/19 22:02:14 miod Exp $ */
/* $NetBSD: boot.c,v 1.10 1997/01/18 01:58:33 cgd Exp $ */
/*
@@ -71,9 +71,8 @@ loadrandom(char *name, char *buf, size_t buflen)
fd = open(name, O_RDONLY);
if (fd == -1) {
- if (errno == EPERM)
- goto fail;
- printf("cannot open %s: %s\n", name, strerror(errno));
+ if (errno != EPERM)
+ printf("cannot open %s: %s\n", name, strerror(errno));
return;
}
if (fstat(fd, &sb) == -1 || sb.st_uid != 0 || !S_ISREG(sb.st_mode) ||