Print this page
10125 smatch fixes for cmd-inet

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c
          +++ new/usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c
↓ open down ↓ 30 lines elided ↑ open up ↑
  31   31   * University Copyright- Copyright (c) 1982, 1986, 1988
  32   32   * The Regents of the University of California.
  33   33   * All Rights Reserved.
  34   34   *
  35   35   * University Acknowledgment- Portions of this document are derived from
  36   36   * software developed by the University of California, Berkeley, and its
  37   37   * contributors.
  38   38   */
  39   39  
  40   40  /*
  41      - * Copyright (c) 2017, Joyent, Inc.
       41 + * Copyright (c) 2018, Joyent, Inc.
  42   42   */
  43   43  
  44   44  #include <assert.h>
  45   45  #include <stdio.h>
  46   46  #include <strings.h>
  47   47  #include <errno.h>
  48   48  #include <fcntl.h>
  49   49  #include <unistd.h>
  50   50  #include <signal.h>
  51   51  #include <limits.h>
↓ open down ↓ 1930 lines elided ↑ open up ↑
1982 1982                          /* Do we have an ICMP packet waiting? */
1983 1983                          if ((recv_sock != -1) && (FD_ISSET(recv_sock, &fds))) {
1984 1984                                  cc = recvmsg(recv_sock, &in_msg, 0);
1985 1985                                  if (cc < 0) {
1986 1986                                          if (errno != EINTR) {
1987 1987                                                  Fprintf(stderr,
1988 1988                                                      "%s: recvmsg %s\n",
1989 1989                                                      progname, strerror(errno));
1990 1990                                          }
1991 1991                                          continue;
1992      -                                } if (cc > 0) {
     1992 +                                } else if (cc > 0) {
1993 1993                                          check_reply(ai_dst, &in_msg, cc,
1994 1994                                              udp_src_port);
1995 1995                                  }
1996 1996                          }
1997 1997                  }
1998 1998                  /*
1999 1999                   * If we were probing last IP address of the target host and
2000 2000                   * received a reply for each probe sent to this address,
2001 2001                   * then we are done!
2002 2002                   */
↓ open down ↓ 612 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX