Module Name:    src
Committed By:   christos
Date:           Thu Jan 12 18:16:52 UTC 2017

Modified Files:
        src/lib/libc/gen: syslog.c
        src/lib/libc/include: namespace.h
        src/lib/libc/stdio: vsnprintf.c

Log Message:
undo SSP damage from -Wsystem-headers


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/lib/libc/gen/syslog.c
cvs rdiff -u -r1.183 -r1.184 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdio/vsnprintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/gen/syslog.c
diff -u src/lib/libc/gen/syslog.c:1.57 src/lib/libc/gen/syslog.c:1.58
--- src/lib/libc/gen/syslog.c:1.57	Wed Jan 11 20:58:39 2017
+++ src/lib/libc/gen/syslog.c	Thu Jan 12 13:16:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslog.c,v 1.57 2017/01/12 01:58:39 christos Exp $	*/
+/*	$NetBSD: syslog.c,v 1.58 2017/01/12 18:16:52 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)syslog.c	8.5 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: syslog.c,v 1.57 2017/01/12 01:58:39 christos Exp $");
+__RCSID("$NetBSD: syslog.c,v 1.58 2017/01/12 18:16:52 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -133,11 +133,7 @@ unlock(const struct syslog_data *data)
 static struct syslog_fun _syslog_fun = {
 	timefun,
 	strerror_r,
-#ifndef __lint__
-	_vsnprintf,
-#else
 	vsnprintf,
-#endif
 	lock,
 	unlock,
 };

Index: src/lib/libc/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.183 src/lib/libc/include/namespace.h:1.184
--- src/lib/libc/include/namespace.h:1.183	Wed Jan 11 19:35:38 2017
+++ src/lib/libc/include/namespace.h	Thu Jan 12 13:16:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.183 2017/01/12 00:35:38 christos Exp $	*/
+/*	$NetBSD: namespace.h,v 1.184 2017/01/12 18:16:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -30,6 +30,7 @@
 #define _NAMESPACE_H_
 
 #include <sys/cdefs.h>
+#include <ssp/ssp.h>
 
 #ifndef __lint__
 #define aio_suspend	_aio_suspend
@@ -625,7 +626,7 @@
 #define sl_free			_sl_free
 #define sl_init			_sl_init
 #define sleep			_sleep
-#ifndef snprintf
+#if __SSP_FORTIFY_LEVEL == 0
 #define snprintf		_snprintf
 #endif
 #define snprintf_l		_snprintf_l
@@ -735,7 +736,7 @@
 #define vasprintf		_vasprintf
 #define vasprintf_l		_vasprintf_l
 #define	vdprintf		_vdprintf
-#ifndef vsnprintf
+#if __SSP_FORTIFY_LEVEL == 0
 #define vsnprintf		_vsnprintf
 #endif
 #define vdprintf_l		_vdprintf_l

Index: src/lib/libc/stdio/vsnprintf.c
diff -u src/lib/libc/stdio/vsnprintf.c:1.28 src/lib/libc/stdio/vsnprintf.c:1.29
--- src/lib/libc/stdio/vsnprintf.c:1.28	Mon Sep 29 10:58:33 2014
+++ src/lib/libc/stdio/vsnprintf.c	Thu Jan 12 13:16:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vsnprintf.c,v 1.28 2014/09/29 14:58:33 christos Exp $	*/
+/*	$NetBSD: vsnprintf.c,v 1.29 2017/01/12 18:16:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)vsnprintf.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: vsnprintf.c,v 1.28 2014/09/29 14:58:33 christos Exp $");
+__RCSID("$NetBSD: vsnprintf.c,v 1.29 2017/01/12 18:16:52 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -51,11 +51,15 @@ __RCSID("$NetBSD: vsnprintf.c,v 1.28 201
 #include "setlocale_local.h"
 #include "local.h"
 
-#if defined(_FORTIFY_SOURCE) && !defined(__lint__)
-#undef vsnprintf
-#define vsnprintf _vsnprintf
-#undef snprintf
-#define snprintf _snprintf
+#if __SSP_FORTIFY_LEVEL != 0
+# undef vsnprintf
+# define vsnprintf _vsnprintf
+# undef snprintf
+# define snprintf _snprintf
+int      snprintf(char * __restrict, size_t, const char * __restrict, ...)
+    __printflike(3, 4);
+int      vsnprintf(char * __restrict, size_t, const char * __restrict,
+    __va_list) __printflike(3, 0);
 #endif
 
 #ifdef __weak_alias

Reply via email to