Source-Changes-HG archive

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

[src/trunk]: src/sys/kern A bit of an ugly workaround to avoid a warning for ...



details:   https://anonhg.NetBSD.org/src/rev/841e3fb29f12
branches:  trunk
changeset: 545888:841e3fb29f12
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Thu Apr 17 13:12:39 2003 +0000

description:
A bit of an ugly workaround to avoid a warning for a larger MSIZE.
Shouldn't make a difference in the generated code.

diffstat:

 sys/kern/uipc_socket2.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 3bf796c2f7d3 -r 841e3fb29f12 sys/kern/uipc_socket2.c
--- a/sys/kern/uipc_socket2.c   Thu Apr 17 12:58:18 2003 +0000
+++ b/sys/kern/uipc_socket2.c   Thu Apr 17 13:12:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket2.c,v 1.49 2003/02/26 06:31:11 matt Exp $   */
+/*     $NetBSD: uipc_socket2.c,v 1.50 2003/04/17 13:12:39 fvdl Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.49 2003/02/26 06:31:11 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.50 2003/04/17 13:12:39 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -669,7 +669,7 @@
        struct mbuf *control)
 {
        struct mbuf     *m, *n, *nlast;
-       int             space;
+       int             space, len;
 
        space = asa->sa_len;
 
@@ -693,7 +693,12 @@
        if (m == 0)
                return (0);
        MCLAIM(m, sb->sb_mowner);
-       if (asa->sa_len > MLEN) {
+       /*
+        * XXX avoid 'comparison always true' warning which isn't easily
+        * avoided.
+        */
+       len = asa->sa_len;
+       if (len > MLEN) {
                MEXTMALLOC(m, asa->sa_len, M_NOWAIT);
                if ((m->m_flags & M_EXT) == 0) {
                        m_free(m);



Home | Main Index | Thread Index | Old Index