summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/crypt/crypt2.c5
-rw-r--r--lib/libc/gen/getcwd.c3
-rw-r--r--lib/libc/gen/getgrent.c4
-rw-r--r--lib/libc/gen/getgrouplist.c4
-rw-r--r--lib/libc/gen/isatty.c3
-rw-r--r--lib/libc/gen/readdir_r.c4
-rw-r--r--lib/libc/gen/scandir.c5
-rw-r--r--lib/libc/rpc/xdr_rec.c3
-rw-r--r--lib/libc/stdio/fputws.c4
-rw-r--r--lib/libc/stdio/vfscanf.c3
-rw-r--r--lib/libc/stdio/vfwprintf.c4
-rw-r--r--lib/libc/stdio/wcio.h4
-rw-r--r--lib/libc/stdlib/strtol.c8
-rw-r--r--lib/libc/stdlib/strtoul.c4
-rw-r--r--lib/libc/termios/tcgetpgrp.c3
-rw-r--r--lib/libc/termios/tcsetpgrp.c3
-rw-r--r--lib/libc/time/localtime.c8
17 files changed, 44 insertions, 28 deletions
diff --git a/lib/libc/crypt/crypt2.c b/lib/libc/crypt/crypt2.c
index 63a297e510d..f31818ae2b1 100644
--- a/lib/libc/crypt/crypt2.c
+++ b/lib/libc/crypt/crypt2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypt2.c,v 1.3 2005/08/08 08:05:33 espie Exp $ */
+/* $OpenBSD: crypt2.c,v 1.4 2013/04/17 17:40:35 tedu Exp $ */
/*
* FreeSec: libcrypt
@@ -59,6 +59,9 @@
extern const u_char _des_bits8[8];
extern const u_int32_t _des_bits32[32];
extern int _des_initialised;
+void _des_init(void);
+void _des_setup_salt(int32_t salt);
+int _des_do_des(u_int32_t , u_int32_t , u_int32_t *, u_int32_t *, int);
int
setkey(const char *key)
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);
diff --git a/lib/libc/rpc/xdr_rec.c b/lib/libc/rpc/xdr_rec.c
index 4e7dfb1e009..da3d41838bd 100644
--- a/lib/libc/rpc/xdr_rec.c
+++ b/lib/libc/rpc/xdr_rec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_rec.c,v 1.15 2010/09/01 14:43:34 millert Exp $ */
+/* $OpenBSD: xdr_rec.c,v 1.16 2013/04/17 17:40:35 tedu Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -409,6 +409,7 @@ xdrrec_destroy(XDR *xdrs)
mem_free(rstrm, sizeof(RECSTREAM));
}
+bool_t __xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata);
/*
* Exported routines to manage xdr records
diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c
index ee76c5bebb8..c4c2d8ea068 100644
--- a/lib/libc/stdio/fputws.c
+++ b/lib/libc/stdio/fputws.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fputws.c,v 1.5 2009/11/09 00:18:27 kurt Exp $ */
+/* $OpenBSD: fputws.c,v 1.6 2013/04/17 17:40:35 tedu Exp $ */
/* $NetBSD: fputws.c,v 1.1 2003/03/07 07:11:37 tshiozak Exp $ */
/*-
@@ -35,6 +35,8 @@
#include <wchar.h>
#include "local.h"
+wint_t __fputwc_unlock(wchar_t wc, FILE *fp);
+
int
fputws(ws, fp)
const wchar_t * __restrict ws;
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 10aac0002e4..c2996a971a0 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfscanf.c,v 1.29 2012/01/18 14:01:38 stsp Exp $ */
+/* $OpenBSD: vfscanf.c,v 1.30 2013/04/17 17:40:35 tedu Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,6 +32,7 @@
*/
#include <ctype.h>
+#include <wctype.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stddef.h>
diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c
index 0619772323d..f76eed3e24c 100644
--- a/lib/libc/stdio/vfwprintf.c
+++ b/lib/libc/stdio/vfwprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfwprintf.c,v 1.5 2012/06/26 14:53:23 matthew Exp $ */
+/* $OpenBSD: vfwprintf.c,v 1.6 2013/04/17 17:40:35 tedu Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -54,6 +54,8 @@
#include "local.h"
#include "fvwrite.h"
+wint_t __fputwc_unlock(wchar_t wc, FILE *fp);
+
union arg {
int intarg;
unsigned int uintarg;
diff --git a/lib/libc/stdio/wcio.h b/lib/libc/stdio/wcio.h
index 1b41ec971d2..584a3f209ed 100644
--- a/lib/libc/stdio/wcio.h
+++ b/lib/libc/stdio/wcio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wcio.h,v 1.1 2005/06/17 20:40:32 espie Exp $ */
+/* $OpenBSD: wcio.h,v 1.2 2013/04/17 17:40:35 tedu Exp $ */
/* $NetBSD: wcio.h,v 1.3 2003/01/18 11:30:00 thorpej Exp $ */
/*-
@@ -76,6 +76,6 @@ do {\
} while (0)
#define WCIO_INIT(fp) \
- memset(WCIO_GET(fp), 0, sizeof(struct wchar_io_data))
+ memset(&(_EXT(fp)->_wcio), 0, sizeof(struct wchar_io_data))
#endif /*_WCIO_H_*/
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 745bc4c2ce2..dc2cf8871cc 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtol.c,v 1.8 2012/11/18 04:13:39 jsing Exp $ */
+/* $OpenBSD: strtol.c,v 1.9 2013/04/17 17:40:35 tedu Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -54,7 +54,7 @@ strtol(const char *nptr, char **endptr, int base)
*/
if (base != 0 && (base < 2 || base > 36)) {
if (endptr != 0)
- *endptr = nptr;
+ *endptr = (char *)nptr;
errno = EINVAL;
return 0;
}
@@ -124,7 +124,7 @@ strtol(const char *nptr, char **endptr, int base)
if (any < 0)
continue;
if (neg) {
- if (acc < cutoff || acc == cutoff && c > cutlim) {
+ if (acc < cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = LONG_MIN;
errno = ERANGE;
@@ -134,7 +134,7 @@ strtol(const char *nptr, char **endptr, int base)
acc -= c;
}
} else {
- if (acc > cutoff || acc == cutoff && c > cutlim) {
+ if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = LONG_MAX;
errno = ERANGE;
diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c
index d7dddab7784..a236365d2f9 100644
--- a/lib/libc/stdlib/strtoul.c
+++ b/lib/libc/stdlib/strtoul.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoul.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strtoul.c,v 1.8 2013/04/17 17:40:35 tedu Exp $ */
/*
* Copyright (c) 1990 Regents of the University of California.
* All rights reserved.
@@ -84,7 +84,7 @@ strtoul(const char *nptr, char **endptr, int base)
break;
if (any < 0)
continue;
- if (acc > cutoff || acc == cutoff && c > cutlim) {
+ if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = ULONG_MAX;
errno = ERANGE;
diff --git a/lib/libc/termios/tcgetpgrp.c b/lib/libc/termios/tcgetpgrp.c
index 70f3a313f51..5c2e0efe296 100644
--- a/lib/libc/termios/tcgetpgrp.c
+++ b/lib/libc/termios/tcgetpgrp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcgetpgrp.c,v 1.5 2005/08/05 13:03:00 espie Exp $ */
+/* $OpenBSD: tcgetpgrp.c,v 1.6 2013/04/17 17:40:35 tedu Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <termios.h>
+#include <unistd.h>
pid_t
tcgetpgrp(int fd)
diff --git a/lib/libc/termios/tcsetpgrp.c b/lib/libc/termios/tcsetpgrp.c
index d101666d3e8..b10e1f40e99 100644
--- a/lib/libc/termios/tcsetpgrp.c
+++ b/lib/libc/termios/tcsetpgrp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcsetpgrp.c,v 1.6 2005/08/05 13:03:00 espie Exp $ */
+/* $OpenBSD: tcsetpgrp.c,v 1.7 2013/04/17 17:40:35 tedu Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <termios.h>
+#include <unistd.h>
int
tcsetpgrp(int fd, pid_t pgrp)
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index 020da1840ba..0d57ea4daa3 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: localtime.c,v 1.37 2011/04/25 13:27:27 millert Exp $ */
+/* $OpenBSD: localtime.c,v 1.38 2013/04/17 17:40:35 tedu Exp $ */
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
@@ -268,7 +268,7 @@ settzname(void)
#endif /* defined ALTZONE */
#ifdef ALL_STATE
if (sp == NULL) {
- tzname[0] = tzname[1] = gmt;
+ tzname[0] = tzname[1] = (char *)gmt;
return;
}
#endif /* defined ALL_STATE */
@@ -321,7 +321,7 @@ const time_t t0;
if (TYPE_INTEGRAL(time_t) &&
TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
return 0;
- return t1 - t0 == SECSPERREPEAT;
+ return (int64_t)t1 - t0 == SECSPERREPEAT;
}
static int
@@ -1414,7 +1414,7 @@ struct tm * const tmp;
else {
#ifdef ALL_STATE
if (gmtptr == NULL)
- tmp->TM_ZONE = gmt;
+ tmp->TM_ZONE = (char *)gmt;
else tmp->TM_ZONE = gmtptr->chars;
#endif /* defined ALL_STATE */
#ifndef ALL_STATE