Module Name: src Committed By: snj Date: Thu May 14 08:15:48 UTC 2015
Modified Files: src/bin/ksh [netbsd-7]: Makefile src/bin/ps [netbsd-7]: print.c src/external/bsd/iscsi/dist/src/lib [netbsd-7]: parameters.c target.c src/external/gpl2/lvm2/dist/lib/commands [netbsd-7]: toolcontext.c src/external/gpl2/lvm2/dist/lib/format1 [netbsd-7]: import-export.c src/gnu/dist/texinfo/makeinfo [netbsd-7]: xml.c src/sbin/bioctl [netbsd-7]: bioctl.c src/usr.sbin/isdn/isdnd [netbsd-7]: msghdl.c Log Message: Pull up following revision(s) (requested by joerg in ticket #758): bin/ksh/Makefile: revision 1.31 bin/ps/print.c: revision 1.123 external/bsd/iscsi/dist/src/lib/parameters.c: revision 1.4 external/bsd/iscsi/dist/src/lib/target.c: revision 1.9 external/gpl2/lvm2/dist/lib/commands/toolcontext.c: revision 1.8 external/gpl2/lvm2/dist/lib/format1/import-export.c: revision 1.2 gnu/dist/texinfo/makeinfo/xml.c: revision 1.2 sbin/bioctl/bioctl.c: revision 1.16 usr.sbin/isdn/isdnd/msghdl.c: revision 1.12 Drop pointer checks that are always true. -- Comment out impossible code. -- Remove tautologic check. -- Skip vendor if the string is empty. Use l_wmesg if the string is not empty. Don't bother checking l_name for nullness. -- Array can't be null. -- Show display if it is not empty. -- Make cast warnings for clang non-fatal. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.30.22.1 src/bin/ksh/Makefile cvs rdiff -u -r1.122 -r1.122.2.1 src/bin/ps/print.c cvs rdiff -u -r1.3 -r1.3.12.1 \ src/external/bsd/iscsi/dist/src/lib/parameters.c cvs rdiff -u -r1.7 -r1.7.26.1 src/external/bsd/iscsi/dist/src/lib/target.c cvs rdiff -u -r1.7 -r1.7.24.1 \ src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c cvs rdiff -u -r1.1.1.2 -r1.1.1.2.24.1 \ src/external/gpl2/lvm2/dist/lib/format1/import-export.c cvs rdiff -u -r1.1.1.5 -r1.1.1.5.38.1 src/gnu/dist/texinfo/makeinfo/xml.c cvs rdiff -u -r1.15 -r1.15.20.1 src/sbin/bioctl/bioctl.c cvs rdiff -u -r1.11 -r1.11.24.1 src/usr.sbin/isdn/isdnd/msghdl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/ksh/Makefile diff -u src/bin/ksh/Makefile:1.30 src/bin/ksh/Makefile:1.30.22.1 --- src/bin/ksh/Makefile:1.30 Sun Oct 16 17:12:11 2011 +++ src/bin/ksh/Makefile Thu May 14 08:15:47 2015 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.30 2011/10/16 17:12:11 joerg Exp $ +# $NetBSD: Makefile,v 1.30.22.1 2015/05/14 08:15:47 snj Exp $ WARNS=3 +CWARNFLAGS.clang+= -Wno-error=cast-qual .include <bsd.own.mk> Index: src/bin/ps/print.c diff -u src/bin/ps/print.c:1.122 src/bin/ps/print.c:1.122.2.1 --- src/bin/ps/print.c:1.122 Sun Apr 20 22:48:59 2014 +++ src/bin/ps/print.c Thu May 14 08:15:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: print.c,v 1.122 2014/04/20 22:48:59 dholland Exp $ */ +/* $NetBSD: print.c,v 1.122.2.1 2015/05/14 08:15:47 snj Exp $ */ /* * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94"; #else -__RCSID("$NetBSD: print.c,v 1.122 2014/04/20 22:48:59 dholland Exp $"); +__RCSID("$NetBSD: print.c,v 1.122.2.1 2015/05/14 08:15:47 snj Exp $"); #endif #endif /* not lint */ @@ -947,7 +947,7 @@ wchan(void *arg, VARENT *ve, enum mode m l = arg; v = ve->var; if (l->l_wchan) { - if (l->l_wmesg) { + if (l->l_wmesg[0]) { strprintorsetwidth(v, l->l_wmesg, mode); v->width = min(v->width, KI_WMESGLEN); } else { @@ -1464,7 +1464,7 @@ lname(void *arg, VARENT *ve, enum mode m l = arg; v = ve->var; - if (l->l_name && l->l_name[0] != '\0') { + if (l->l_name[0] != '\0') { strprintorsetwidth(v, l->l_name, mode); v->width = min(v->width, KI_LNAMELEN); } else { Index: src/external/bsd/iscsi/dist/src/lib/parameters.c diff -u src/external/bsd/iscsi/dist/src/lib/parameters.c:1.3 src/external/bsd/iscsi/dist/src/lib/parameters.c:1.3.12.1 --- src/external/bsd/iscsi/dist/src/lib/parameters.c:1.3 Thu Mar 15 04:06:54 2012 +++ src/external/bsd/iscsi/dist/src/lib/parameters.c Thu May 14 08:15:47 2015 @@ -919,12 +919,7 @@ answer: if (strcmp(value, "?") == 0) { iscsi_trace(TRACE_ISCSI_PARAM, "got inquiry for param \"%s\"\n", param->key); if (param->value_l) { - if (param->value_l->value) { - (void) strlcpy(param->answer_tx, param->value_l->value, sizeof(param->answer_tx)); - } else { - iscsi_err(__FILE__, __LINE__, "param \"%s\" has NULL value_l->value\n", param->key); - param->answer_tx[0] = 0x0; - } + (void) strlcpy(param->answer_tx, param->value_l->value, sizeof(param->answer_tx)); } else { iscsi_err(__FILE__, __LINE__, "param \"%s\" has NULL value_l\n", param->key); param->answer_tx[0] = 0x0; Index: src/external/bsd/iscsi/dist/src/lib/target.c diff -u src/external/bsd/iscsi/dist/src/lib/target.c:1.7 src/external/bsd/iscsi/dist/src/lib/target.c:1.7.26.1 --- src/external/bsd/iscsi/dist/src/lib/target.c:1.7 Wed Mar 3 00:44:51 2010 +++ src/external/bsd/iscsi/dist/src/lib/target.c Thu May 14 08:15:47 2015 @@ -764,8 +764,7 @@ text_command_t(target_session_t * sess, return -1; } if (ptr->rx_offer) { - if (ptr->offer_rx && - strcmp(ptr->offer_rx, "All") == 0 && + if (strcmp(ptr->offer_rx, "All") == 0 && !param_equiv(sess->params, "SessionType", "Discovery")) { iscsi_trace(TRACE_ISCSI_DEBUG, Index: src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c diff -u src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7 src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7.24.1 --- src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7 Sat Dec 5 01:52:44 2009 +++ src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c Thu May 14 08:15:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: toolcontext.c,v 1.7 2009/12/05 01:52:44 haad Exp $ */ +/* $NetBSD: toolcontext.c,v 1.7.24.1 2015/05/14 08:15:47 snj Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -992,12 +992,14 @@ static int _init_backup(struct cmd_conte char default_dir[PATH_MAX]; const char *dir; +#if 0 if (!cmd->system_dir) { log_warn("WARNING: Metadata changes will NOT be backed up"); backup_init(cmd, "", 0); archive_init(cmd, "", 0, 0, 0); return 1; } +#endif /* set up archiving */ cmd->default_settings.archive = Index: src/external/gpl2/lvm2/dist/lib/format1/import-export.c diff -u src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2 src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2.24.1 --- src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2 Wed Dec 2 00:26:49 2009 +++ src/external/gpl2/lvm2/dist/lib/format1/import-export.c Thu May 14 08:15:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: import-export.c,v 1.1.1.2 2009/12/02 00:26:49 haad Exp $ */ +/* $NetBSD: import-export.c,v 1.1.1.2.24.1 2015/05/14 08:15:47 snj Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -187,7 +187,7 @@ int export_pv(struct cmd_context *cmd, s } /* Generate system_id if PV is in VG */ - if (!pvd->system_id || !*pvd->system_id) + if (!pvd->system_id[0]) if (!_system_id(cmd, (char *)pvd->system_id, "")) return_0; Index: src/gnu/dist/texinfo/makeinfo/xml.c diff -u src/gnu/dist/texinfo/makeinfo/xml.c:1.1.1.5 src/gnu/dist/texinfo/makeinfo/xml.c:1.1.1.5.38.1 --- src/gnu/dist/texinfo/makeinfo/xml.c:1.1.1.5 Tue Sep 2 07:50:51 2008 +++ src/gnu/dist/texinfo/makeinfo/xml.c Thu May 14 08:15:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: xml.c,v 1.1.1.5 2008/09/02 07:50:51 christos Exp $ */ +/* $NetBSD: xml.c,v 1.1.1.5.38.1 2015/05/14 08:15:47 snj Exp $ */ /* xml.c -- xml output. Id: xml.c,v 1.52 2004/12/19 17:02:23 karl Exp @@ -870,7 +870,7 @@ xml_insert_element_with_attribute (elt, return; } - if (!xml_element_list[elt].name || !strlen (xml_element_list[elt].name)) + if (!strlen (xml_element_list[elt].name)) { /*printf ("Warning: Inserting empty element %d\n", elt);*/ return; Index: src/sbin/bioctl/bioctl.c diff -u src/sbin/bioctl/bioctl.c:1.15 src/sbin/bioctl/bioctl.c:1.15.20.1 --- src/sbin/bioctl/bioctl.c:1.15 Mon Aug 29 14:34:58 2011 +++ src/sbin/bioctl/bioctl.c Thu May 14 08:15:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bioctl.c,v 1.15 2011/08/29 14:34:58 joerg Exp $ */ +/* $NetBSD: bioctl.c,v 1.15.20.1 2015/05/14 08:15:48 snj Exp $ */ /* $OpenBSD: bioctl.c,v 1.52 2007/03/20 15:26:06 jmc Exp $ */ /* @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: bioctl.c,v 1.15 2011/08/29 14:34:58 joerg Exp $"); +__RCSID("$NetBSD: bioctl.c,v 1.15.20.1 2015/05/14 08:15:48 snj Exp $"); #endif #include <sys/types.h> @@ -292,7 +292,7 @@ bio_show_volumes(struct biotmp *bt) } snprintf(bt->volname, sizeof(bt->volname), "%u", bv.bv_volid); - if (bv.bv_vendor) + if (bv.bv_vendor[0]) snprintf(tmp, sizeof(tmp), "%s %s", bv.bv_dev, bv.bv_vendor); else snprintf(tmp, sizeof(tmp), "%s", bv.bv_dev); Index: src/usr.sbin/isdn/isdnd/msghdl.c diff -u src/usr.sbin/isdn/isdnd/msghdl.c:1.11 src/usr.sbin/isdn/isdnd/msghdl.c:1.11.24.1 --- src/usr.sbin/isdn/isdnd/msghdl.c:1.11 Thu Apr 16 05:56:32 2009 +++ src/usr.sbin/isdn/isdnd/msghdl.c Thu May 14 08:15:48 2015 @@ -27,7 +27,7 @@ * i4b daemon - message from kernel handling routines * -------------------------------------------------- * - * $Id: msghdl.c,v 1.11 2009/04/16 05:56:32 lukem Exp $ + * $Id: msghdl.c,v 1.11.24.1 2015/05/14 08:15:48 snj Exp $ * * $FreeBSD$ * @@ -149,7 +149,7 @@ msg_connect_ind(msg_connect_ind_t *mp, i decr_free_channels(find_ctrl_state(mp->controller)); if (cep->alert) { - if (mp->display) + if (mp->display[0]) { logit(LL_CHD, "%05d %s alerting: incoming call from %s to %s (%s)", mp->header.cdid, cep->name, SRC, DST, mp->display); @@ -163,7 +163,7 @@ msg_connect_ind(msg_connect_ind_t *mp, i } else { - if (mp->display) + if (mp->display[0]) { logit(LL_CHD, "%05d %s answering: incoming call from %s to %s (%s)", mp->header.cdid, cep->name, SRC, DST, mp->display);