Browse Source

opendev() path argument should be const. OK deraadt@

OPENBSD_4_9
millert 14 years ago
parent
commit
642ed026af
3 changed files with 8 additions and 8 deletions
  1. +3
    -3
      src/lib/libutil/opendev.3
  2. +3
    -3
      src/lib/libutil/opendev.c
  3. +2
    -2
      src/lib/libutil/util.h

+ 3
- 3
src/lib/libutil/opendev.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: opendev.3,v 1.18 2010/04/01 17:06:55 jmc Exp $
.\" $OpenBSD: opendev.3,v 1.19 2010/12/17 19:35:34 millert Exp $
.\"
.\" Copyright (c) 2000, Todd C. Miller. All rights reserved.
.\" Copyright (c) 1996, Jason Downs. All rights reserved.
@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: April 1 2010 $
.Dd $Mdocdate: December 17 2010 $
.Dt OPENDEV 3
.Os
.Sh NAME
@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Fd #include <util.h>
.Ft int
.Fn opendev "char *path" "int oflags" "int dflags" "char **realpath"
.Fn opendev "const char *path" "int oflags" "int dflags" "char **realpath"
.Sh DESCRIPTION
The
.Fn opendev


+ 3
- 3
src/lib/libutil/opendev.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: opendev.c,v 1.11 2010/11/15 15:07:40 jsing Exp $ */
/* $OpenBSD: opendev.c,v 1.12 2010/12/17 19:35:34 millert Exp $ */
/*
* Copyright (c) 2000, Todd C. Miller. All rights reserved.
@ -46,7 +46,7 @@
* disklabel(8).
*/
int
opendev(char *path, int oflags, int dflags, char **realpath)
opendev(const char *path, int oflags, int dflags, char **realpath)
{
static char namebuf[PATH_MAX];
struct dk_diskmap dm;
@ -55,7 +55,7 @@ opendev(char *path, int oflags, int dflags, char **realpath)
/* Initial state */
if (realpath)
*realpath = path;
*realpath = (char *)path;
fd = -1;
errno = ENOENT;


+ 2
- 2
src/lib/libutil/util.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: util.h,v 1.28 2010/11/15 15:07:40 jsing Exp $ */
/* $OpenBSD: util.h,v 1.29 2010/12/17 19:35:34 millert Exp $ */
/* $NetBSD: util.h,v 1.2 1996/05/16 07:00:22 thorpej Exp $ */
/*-
@ -86,7 +86,7 @@ void login(struct utmp *);
int login_tty(int);
int logout(const char *);
void logwtmp(const char *, const char *, const char *);
int opendev(char *, int, int, char **);
int opendev(const char *, int, int, char **);
int pidfile(const char *);
void pw_setdir(const char *);
char *pw_file(const char *);


Loading…
Cancel
Save