Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh
          +++ new/usr/src/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16  # fields enclosed by brackets "[]" replaced with your own identifying
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24   24  # Use is subject to license terms.
  25   25  #
  26      -#ident  "%Z%%M% %I%     %E% SMI"
  27   26  
  28   27  script()
  29   28  {
  30   29          $dtrace -wq -o $tmpfile -s /dev/stdin 2> $errfile <<EOF
  31   30          BEGIN
  32   31          {
  33   32                  /*
  34   33                   * All of these should fail...
  35   34                   */
  36   35                  freopen("..");
↓ open down ↓ 43 lines elided ↑ open up ↑
  80   79  
  81   80  if [ "$status" -eq 0 ]; then
  82   81          i=`cat $tmpfile`
  83   82  
  84   83          if [[ $i != "123" ]]; then
  85   84                  echo "$0: unexpected contents in $tmpfile: " \
  86   85                      "expected 123, found $i"
  87   86                  status=100
  88   87          fi
  89   88          
  90      -        i=`wc -l $errfile | nawk '{ print $1 }'`
       89 +        i=`wc -l $errfile | /usr/xpg4/bin/awk '{ print $1 }'`
  91   90  
  92   91          if [ "$i" -lt 6 ]; then
  93   92                  echo "$0: expected at least 6 lines of stderr, found $i lines"
  94   93                  status=101
  95   94          fi
  96   95  else
  97   96          cat $errfile > /dev/fd/2
  98   97  fi
  99   98  
 100   99  rm $tmpfile $errfile
 101  100  
 102  101  exit $status
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX