Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libperfuse simplify and eliminate non literal string for...
details: https://anonhg.NetBSD.org/src/rev/b9baa6a52576
branches: trunk
changeset: 768295:b9baa6a52576
user: christos <christos%NetBSD.org@localhost>
date: Sun Aug 14 08:19:04 2011 +0000
description:
simplify and eliminate non literal string formats.
diffstat:
lib/libperfuse/Makefile | 6 +-----
lib/libperfuse/perfuse_if.h | 27 +++++++++------------------
2 files changed, 10 insertions(+), 23 deletions(-)
diffs (69 lines):
diff -r bd528770d245 -r b9baa6a52576 lib/libperfuse/Makefile
--- a/lib/libperfuse/Makefile Sun Aug 14 08:14:00 2011 +0000
+++ b/lib/libperfuse/Makefile Sun Aug 14 08:19:04 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2011/08/13 23:12:15 christos Exp $
+# $NetBSD: Makefile,v 1.8 2011/08/14 08:19:04 christos Exp $
LIB= perfuse
LIBDPLIBS+= puffs ${.CURDIR}/../libpuffs
@@ -16,8 +16,4 @@
INCS= perfuse.h
INCSDIR= /usr/include
-COPTS.ops.c = -Wno-format-nonliteral
-COPTS.perfuse.c = -Wno-format-nonliteral
-COPTS.subr.c = -Wno-format-nonliteral
-
.include <bsd.lib.mk>
diff -r bd528770d245 -r b9baa6a52576 lib/libperfuse/perfuse_if.h
--- a/lib/libperfuse/perfuse_if.h Sun Aug 14 08:14:00 2011 +0000
+++ b/lib/libperfuse/perfuse_if.h Sun Aug 14 08:19:04 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: perfuse_if.h,v 1.14 2011/08/13 23:12:15 christos Exp $ */
+/* $NetBSD: perfuse_if.h,v 1.15 2011/08/14 08:19:04 christos Exp $ */
/*-
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -77,18 +77,15 @@
} while (0 /* CONSTCOND */)
#define DERR(status, fmt, ...) do { \
- char fmterr[BUFSIZ]; \
- char strerrbuf[BUFSIZ]; \
- \
- (void)strerror_r(errno, strerrbuf, sizeof(strerrbuf)); \
- (void)snprintf(fmterr, sizeof(fmterr), "%s: %s\n", fmt, \
- strerrbuf); \
- \
if (perfuse_diagflags & PDF_SYSLOG) \
- syslog(LOG_ERR, fmterr, ## __VA_ARGS__); \
+ syslog(LOG_ERR, fmt ": %m", ## __VA_ARGS__); \
\
if (perfuse_diagflags & PDF_FOREGROUND) { \
- (void)fprintf(stderr, fmterr, ## __VA_ARGS__); \
+ char strerrbuf[BUFSIZ]; \
+ \
+ (void)strerror_r(errno, strerrbuf, sizeof(strerrbuf)); \
+ (void)fprintf(stderr, fmt ": %s", ## __VA_ARGS__, \
+ strerrbuf); \
abort(); \
} else { \
err(status, fmt, ## __VA_ARGS__); \
@@ -104,14 +101,8 @@
#define DWARN(fmt, ...) do { \
\
- if (perfuse_diagflags & PDF_SYSLOG) { \
- char fmterr[BUFSIZ]; \
- char strerrbuf[BUFSIZ]; \
- \
- (void)strerror_r(errno, strerrbuf, sizeof(strerrbuf)); \
- (void)sprintf(fmterr, "%s: %s\n", fmt, strerrbuf); \
- syslog(LOG_WARNING, fmterr, ## __VA_ARGS__); \
- } \
+ if (perfuse_diagflags & PDF_SYSLOG) \
+ syslog(LOG_WARNING, fmt ": %m", ## __VA_ARGS__); \
\
warn(fmt, ## __VA_ARGS__); \
} while (0 /* CONSTCOND */)
Home |
Main Index |
Thread Index |
Old Index