diff options
author | 2013-04-17 17:40:35 +0000 | |
---|---|---|
committer | 2013-04-17 17:40:35 +0000 | |
commit | 928cef96820a77291fe483e919fcbcc7abcb3319 (patch) | |
tree | 6d2f17e88a0caab51454d7a136558371549f03ca /lib/libc/gen | |
parent | silence some warnings by adding prototypes, casts, and headers as (diff) | |
download | wireguard-openbsd-928cef96820a77291fe483e919fcbcc7abcb3319.tar.xz wireguard-openbsd-928cef96820a77291fe483e919fcbcc7abcb3319.zip |
add some prototypes, casts, includes, parenthesis, and whatnot to
silence some warnings.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/getcwd.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/getgrent.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/getgrouplist.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/isatty.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/readdir_r.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/scandir.c | 5 |
6 files changed, 14 insertions, 9 deletions
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c index 82bd19e26a4..f217b4c4bae 100644 --- a/lib/libc/gen/getcwd.c +++ b/lib/libc/gen/getcwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getcwd.c,v 1.17 2006/05/27 18:06:29 pedro Exp $ */ +/* $OpenBSD: getcwd.c,v 1.18 2013/04/17 17:40:35 tedu Exp $ */ /* * Copyright (c) 2005 Marius Eriksen <marius@openbsd.org> @@ -19,6 +19,7 @@ #include <sys/param.h> #include <errno.h> #include <stdlib.h> +#include <unistd.h> int __getcwd(char *buf, size_t len); diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 080ea55cc8b..72b030b0bad 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrent.c,v 1.37 2011/04/25 20:10:10 sthen Exp $ */ +/* $OpenBSD: getgrent.c,v 1.38 2013/04/17 17:40:35 tedu Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -392,7 +392,7 @@ grscan(int search, gid_t gid, const char *name, struct group *p_gr, goto found_it; default: bp = strsep(&bp, ":\n") + 1; - if (search && name && strcmp(bp, name) || + if ((search && name && strcmp(bp, name)) || __ypexclude_is(&__ypexhead, bp)) continue; r = yp_match(__ypdomain, "group.byname", diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 3faef2d898f..237abec4eeb 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrouplist.c,v 1.21 2009/11/09 00:18:27 kurt Exp $ */ +/* $OpenBSD: getgrouplist.c,v 1.22 2013/04/17 17:40:35 tedu Exp $ */ /* * Copyright (c) 2008 Ingo Schwarze <schwarze@usta.de> * Copyright (c) 1991, 1993 @@ -202,7 +202,7 @@ getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt) /* Construct the netid key to look up. */ if (getpwnam_r(uname, &pwstore, buf, sizeof buf, NULL) || - !__ypdomain && yp_get_default_domain(&__ypdomain)) + (!__ypdomain && yp_get_default_domain(&__ypdomain))) goto out; asprintf(&key, "unix.%u@%s", pwstore.pw_uid, __ypdomain); if (key == NULL) diff --git a/lib/libc/gen/isatty.c b/lib/libc/gen/isatty.c index 1915c6c3392..0a94648a29f 100644 --- a/lib/libc/gen/isatty.c +++ b/lib/libc/gen/isatty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isatty.c,v 1.7 2007/05/23 18:30:07 kurt Exp $ */ +/* $OpenBSD: isatty.c,v 1.8 2013/04/17 17:40:35 tedu Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -29,6 +29,7 @@ */ #include <termios.h> +#include <unistd.h> int isatty(int fd) diff --git a/lib/libc/gen/readdir_r.c b/lib/libc/gen/readdir_r.c index f32d08a7044..06170fcec45 100644 --- a/lib/libc/gen/readdir_r.c +++ b/lib/libc/gen/readdir_r.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readdir_r.c,v 1.2 2012/03/22 04:11:53 matthew Exp $ */ +/* $OpenBSD: readdir_r.c,v 1.3 2013/04/17 17:40:35 tedu Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -35,6 +35,8 @@ #include "telldir.h" #include "thread_private.h" +int _readdir_unlocked(DIR *, struct dirent **, int); + int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) { diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 3e3f7eb11b3..e128ec5337f 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scandir.c,v 1.15 2012/11/29 02:15:44 guenther Exp $ */ +/* $OpenBSD: scandir.c,v 1.16 2013/04/17 17:40:35 tedu Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -125,7 +125,8 @@ scandir(const char *dirname, struct dirent ***namelist, } closedir(dirp); if (nitems && dcomp != NULL) - qsort(names, nitems, sizeof(struct dirent *), dcomp); + qsort(names, nitems, sizeof(struct dirent *), + (int(*)(const void *, const void *))dcomp); *namelist = names; return (nitems); |