Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src Pull up following revision(s) (requested by joerg in tick...



details:   https://anonhg.NetBSD.org/src/rev/7944c1b31a2a
branches:  netbsd-7
changeset: 799324:7944c1b31a2a
user:      snj <snj%NetBSD.org@localhost>
date:      Thu May 14 08:15:47 2015 +0000

description:
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.

diffstat:

 bin/ksh/Makefile                                    |  3 ++-
 bin/ps/print.c                                      |  8 ++++----
 external/bsd/iscsi/dist/src/lib/parameters.c        |  7 +------
 external/bsd/iscsi/dist/src/lib/target.c            |  3 +--
 external/gpl2/lvm2/dist/lib/commands/toolcontext.c  |  4 +++-
 external/gpl2/lvm2/dist/lib/format1/import-export.c |  4 ++--
 gnu/dist/texinfo/makeinfo/xml.c                     |  4 ++--
 sbin/bioctl/bioctl.c                                |  6 +++---
 usr.sbin/isdn/isdnd/msghdl.c                        |  6 +++---
 9 files changed, 21 insertions(+), 24 deletions(-)

diffs (195 lines):

diff -r eed266344d3d -r 7944c1b31a2a bin/ksh/Makefile
--- a/bin/ksh/Makefile  Thu May 14 07:58:49 2015 +0000
+++ b/bin/ksh/Makefile  Thu May 14 08:15:47 2015 +0000
@@ -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>
 
diff -r eed266344d3d -r 7944c1b31a2a bin/ps/print.c
--- a/bin/ps/print.c    Thu May 14 07:58:49 2015 +0000
+++ b/bin/ps/print.c    Thu May 14 08:15:47 2015 +0000
@@ -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 @@
        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 @@
 
        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 {
diff -r eed266344d3d -r 7944c1b31a2a external/bsd/iscsi/dist/src/lib/parameters.c
--- a/external/bsd/iscsi/dist/src/lib/parameters.c      Thu May 14 07:58:49 2015 +0000
+++ b/external/bsd/iscsi/dist/src/lib/parameters.c      Thu May 14 08:15:47 2015 +0000
@@ -919,12 +919,7 @@
                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;
diff -r eed266344d3d -r 7944c1b31a2a external/bsd/iscsi/dist/src/lib/target.c
--- a/external/bsd/iscsi/dist/src/lib/target.c  Thu May 14 07:58:49 2015 +0000
+++ b/external/bsd/iscsi/dist/src/lib/target.c  Thu May 14 08:15:47 2015 +0000
@@ -764,8 +764,7 @@
                        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,
diff -r eed266344d3d -r 7944c1b31a2a external/gpl2/lvm2/dist/lib/commands/toolcontext.c
--- a/external/gpl2/lvm2/dist/lib/commands/toolcontext.c        Thu May 14 07:58:49 2015 +0000
+++ b/external/gpl2/lvm2/dist/lib/commands/toolcontext.c        Thu May 14 08:15:47 2015 +0000
@@ -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 @@
        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 =
diff -r eed266344d3d -r 7944c1b31a2a external/gpl2/lvm2/dist/lib/format1/import-export.c
--- a/external/gpl2/lvm2/dist/lib/format1/import-export.c       Thu May 14 07:58:49 2015 +0000
+++ b/external/gpl2/lvm2/dist/lib/format1/import-export.c       Thu May 14 08:15:47 2015 +0000
@@ -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 @@
        }
 
        /* 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;
 
diff -r eed266344d3d -r 7944c1b31a2a gnu/dist/texinfo/makeinfo/xml.c
--- a/gnu/dist/texinfo/makeinfo/xml.c   Thu May 14 07:58:49 2015 +0000
+++ b/gnu/dist/texinfo/makeinfo/xml.c   Thu May 14 08:15:47 2015 +0000
@@ -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 @@
       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;
diff -r eed266344d3d -r 7944c1b31a2a sbin/bioctl/bioctl.c
--- a/sbin/bioctl/bioctl.c      Thu May 14 07:58:49 2015 +0000
+++ b/sbin/bioctl/bioctl.c      Thu May 14 08:15:47 2015 +0000
@@ -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 @@
        }
 
        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);
diff -r eed266344d3d -r 7944c1b31a2a usr.sbin/isdn/isdnd/msghdl.c
--- a/usr.sbin/isdn/isdnd/msghdl.c      Thu May 14 07:58:49 2015 +0000
+++ b/usr.sbin/isdn/isdnd/msghdl.c      Thu May 14 08:15:47 2015 +0000
@@ -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 @@
                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 @@
                }
                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);



Home | Main Index | Thread Index | Old Index