summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2007-06-24 17:41:09 +0000
committerpooka <pooka@NetBSD.org>2007-06-24 17:41:09 +0000
commit86e63e7e2713871bbbab8cae0dfde2f262dff589 (patch)
tree5205477528bda51b3e1e8a3c9c46047030e2bf17 /lib
parentcf3eceb66e825aa500c36d534bc850c268828695 (diff)
don't return errno from a function which returns an fd - there's
a "little" room for confusion. instead, return -1 and let the caller grab errno.
Diffstat (limited to 'lib')
-rw-r--r--lib/libpuffs/null.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libpuffs/null.c b/lib/libpuffs/null.c
index ce5b6275e49..4225b61b34e 100644
--- a/lib/libpuffs/null.c
+++ b/lib/libpuffs/null.c
@@ -1,4 +1,4 @@
-/* $NetBSD: null.c,v 1.14 2007/06/06 01:55:01 pooka Exp $ */
+/* $NetBSD: null.c,v 1.15 2007/06/24 17:41:09 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: null.c,v 1.14 2007/06/06 01:55:01 pooka Exp $");
+__RCSID("$NetBSD: null.c,v 1.15 2007/06/24 17:41:09 pooka Exp $");
#endif /* !lint */
/*
@@ -102,11 +102,11 @@ writeableopen(const char *path)
if (fd == -1) {
if (errno == EACCES) {
if (stat(path, &sb) == -1)
- return errno;
+ return -1;
origmode = sb.st_mode & ALLPERMS;
if (chmod(path, 0200) == -1)
- return errno;
+ return -1;
fd = open(path, O_WRONLY);
if (fd == -1)
@@ -116,7 +116,7 @@ writeableopen(const char *path)
if (sverr)
errno = sverr;
} else
- return errno;
+ return -1;
}
return fd;