Print this page
OS-1571 Placate gcc -Wparentheses
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/lxproc/lxpr_vnops.c
          +++ new/usr/src/uts/common/fs/lxproc/lxpr_vnops.c
↓ open down ↓ 2659 lines elided ↑ open up ↑
2660 2660                          break;
2661 2661                  }
2662 2662  
2663 2663                  /*
2664 2664                   * uiomove() updates both uiop->uio_resid and uiop->uio_offset
2665 2665                   * by the same amount.  But we want uiop->uio_offset to change
2666 2666                   * in increments of LXPR_SDSIZE, which is different from the
2667 2667                   * number of bytes being returned to the user.  So we set
2668 2668                   * uiop->uio_offset separately, ignoring what uiomove() does.
2669 2669                   */
2670      -                if (error = uiomove((caddr_t)dirent, reclen, UIO_READ, uiop)) {
     2670 +                if ((error = uiomove((caddr_t)dirent, reclen, UIO_READ,
     2671 +                    uiop)) != 0)
2671 2672                          return (error);
2672      -                }
2673 2673  
2674 2674                  uiop->uio_offset = uoffset + LXPR_SDSIZE;
2675 2675          }
2676 2676  
2677 2677          /* Have run out of space, but could have just done last table entry */
2678 2678          if (eofp) {
2679 2679                  *eofp =
2680 2680                      (uiop->uio_offset >= ((dirtablen+2) * LXPR_SDSIZE)) ? 1 : 0;
2681 2681          }
2682 2682          return (0);
↓ open down ↓ 115 lines elided ↑ open up ↑
2798 2798                  }
2799 2799  
2800 2800                  /*
2801 2801                   * uiomove() updates both uiop->uio_resid and uiop->uio_offset
2802 2802                   * by the same amount.  But we want uiop->uio_offset to change
2803 2803                   * in increments of LXPR_SDSIZE, which is different from the
2804 2804                   * number of bytes being returned to the user.  So we set
2805 2805                   * uiop->uio_offset separately, in the increment of this for
2806 2806                   * the loop, ignoring what uiomove() does.
2807 2807                   */
2808      -                if (error = uiomove((caddr_t)dirent, reclen, UIO_READ, uiop))
     2808 +                if ((error = uiomove((caddr_t)dirent, reclen, UIO_READ,
     2809 +                    uiop)) != 0)
2809 2810                          return (error);
2810 2811  next:
2811 2812                  uiop->uio_offset = uoffset + LXPR_SDSIZE;
2812 2813          }
2813 2814  
2814 2815          if (eofp != NULL) {
2815 2816                  *eofp = (uiop->uio_offset >=
2816 2817                      ((v.v_proc + PROCDIRFILES + 2) * LXPR_SDSIZE)) ? 1 : 0;
2817 2818          }
2818 2819  
↓ open down ↓ 111 lines elided ↑ open up ↑
2930 2931  
2931 2932                  if (reclen > uresid) {
2932 2933                          /*
2933 2934                           * Error if no entries have been returned yet.
2934 2935                           */
2935 2936                          if (uresid == oresid)
2936 2937                                  error = EINVAL;
2937 2938                          goto out;
2938 2939                  }
2939 2940  
2940      -                if (error = uiomove((caddr_t)dirent, reclen, UIO_READ, uiop))
     2941 +                if ((error = uiomove((caddr_t)dirent, reclen, UIO_READ,
     2942 +                    uiop)) != 0)
2941 2943                          goto out;
2942 2944          }
2943 2945  
2944 2946          if (eofp != NULL) {
2945 2947                  *eofp =
2946 2948                      (uiop->uio_offset >= ((fddirsize+2) * LXPR_SDSIZE)) ? 1 : 0;
2947 2949          }
2948 2950  
2949 2951  out:
2950 2952          mutex_exit(&fip->fi_lock);
↓ open down ↓ 127 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX