diff options
author | 2012-11-29 02:15:44 +0000 | |
---|---|---|
committer | 2012-11-29 02:15:44 +0000 | |
commit | a737da78244b7083cf46696406625dd05c33eafa (patch) | |
tree | 4d2b2009264ea914ac361e9067525a99b1abeb74 /lib/libc | |
parent | Fix white spaces in relayd. No binary diff. (diff) | |
download | wireguard-openbsd-a737da78244b7083cf46696406625dd05c33eafa.tar.xz wireguard-openbsd-a737da78244b7083cf46696406625dd05c33eafa.zip |
Change scandir()'s 'select' argument from
int (*)(struct dirent *)
to
int (*)(const struct dirent *)
to match POSIX.
ok millert@, ports check by naddy@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/scandir.3 | 14 | ||||
-rw-r--r-- | lib/libc/gen/scandir.c | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3 index 92eb6d3ed66..20c2ab7f005 100644 --- a/lib/libc/gen/scandir.3 +++ b/lib/libc/gen/scandir.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: scandir.3,v 1.11 2012/03/24 18:52:42 guenther Exp $ +.\" $OpenBSD: scandir.3,v 1.12 2012/11/29 02:15:44 guenther Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: March 24 2012 $ +.Dd $Mdocdate: November 29 2012 $ .Dt SCANDIR 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Fd #include <sys/types.h> .Fd #include <dirent.h> .Ft int -.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\*(rp\*(lpstruct dirent *\*(rp" "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" +.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Ft int .Fn alphasort "const struct dirent **d1" "const struct dirent **d2" .Sh DESCRIPTION @@ -124,3 +124,11 @@ and then finally changed by .St -p1003.1-2008 to their current form of .Vt "const struct dirent **" . +Similarly, the +.Fn select +argument to +.Fn scandir +was originally +.Vt "struct dirent *" +until it was changed to its current form of +.Vt "const struct dirent *" . diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index cbd7148f28b..3e3f7eb11b3 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scandir.c,v 1.14 2012/03/22 04:11:53 matthew Exp $ */ +/* $OpenBSD: scandir.c,v 1.15 2012/11/29 02:15:44 guenther Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -57,7 +57,7 @@ int scandir(const char *dirname, struct dirent ***namelist, - int (*select)(struct dirent *), + int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, const struct dirent **)) { struct dirent *d, *p, **names = NULL; |