summaryrefslogtreecommitdiffstats
path: root/lib/libutil/opendev.c
diff options
context:
space:
mode:
authordownsj <downsj@openbsd.org>1996-06-17 07:46:01 +0000
committerdownsj <downsj@openbsd.org>1996-06-17 07:46:01 +0000
commitad69070a1c36cc66a22afcd5d5f5043db29abcaf (patch)
tree0099173d1ac995d22bb728542655e2501d1a9c1c /lib/libutil/opendev.c
parentI'm moving util.h to it's proper place, damnit. (diff)
downloadwireguard-openbsd-ad69070a1c36cc66a22afcd5d5f5043db29abcaf.tar.xz
wireguard-openbsd-ad69070a1c36cc66a22afcd5d5f5043db29abcaf.zip
util.h: new resting place
opendev.h: ok, so I merged it with util.h opendev.h: use util.h everything else: use "util.h"
Diffstat (limited to 'lib/libutil/opendev.c')
-rw-r--r--lib/libutil/opendev.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libutil/opendev.c b/lib/libutil/opendev.c
index 66b50e08134..6603dc0791a 100644
--- a/lib/libutil/opendev.c
+++ b/lib/libutil/opendev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: opendev.c,v 1.1 1996/06/17 06:35:34 downsj Exp $ */
+/* $OpenBSD: opendev.c,v 1.2 1996/06/17 07:46:03 downsj Exp $ */
/*
* Copyright (c) 1996, Jason Downs. All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/disklabel.h>
#include <paths.h>
-#include "opendev.h"
+#include "util.h"
/*
* This routine is a generic rewrite of the original code found in
@@ -39,11 +39,10 @@
*/
int
-opendev(path, oflags, dflags, mode, realpath)
+opendev(path, oflags, dflags, realpath)
char *path;
int oflags;
int dflags;
- mode_t mode;
char **realpath;
{
int fd;
@@ -51,7 +50,7 @@ opendev(path, oflags, dflags, mode, realpath)
*realpath = path;
- fd = open(path, oflags, mode);
+ fd = open(path, oflags);
if ((fd < 0) && (errno == ENOENT)) {
if (path[0] != '/') {
if (dflags & OPENDEV_PART) {
@@ -61,14 +60,14 @@ opendev(path, oflags, dflags, mode, realpath)
*/
(void)snprintf(namebuf, sizeof(namebuf),
"%sr%s%c", _PATH_DEV, path, 'a' + RAW_PART);
- fd = open(namebuf, oflags, mode);
+ fd = open(namebuf, oflags);
}
if ((dflags & OPENDEV_DRCT) && (fd < 0) &&
(errno == ENOENT)) {
/* ..and now no partition (for tapes) */
namebuf[strlen(namebuf) - 1] = '\0';
- fd = open(namebuf, oflags, mode);
+ fd = open(namebuf, oflags);
}
*realpath = namebuf;
@@ -77,7 +76,7 @@ opendev(path, oflags, dflags, mode, realpath)
if ((fd < 0) && (errno == ENOENT) && (path[0] != '/')) {
(void)snprintf(namebuf, sizeof(namebuf), "%sr%s",
_PATH_DEV, path);
- fd = open(namebuf, oflags, mode);
+ fd = open(namebuf, oflags);
*realpath = namebuf;
}