Exit Status Not Returned?

From: absinth (absinth_at_gmail.com)
Date: 04/29/05


Date: 28 Apr 2005 22:55:57 -0700

Can someone help me with this in KSH and tell me why the exit status is
not returned?

Why is "haha" printed?

#!/bin/ksh

getNoGlobalProc()
{
   local a=`ls sdfafa`

   if [[ $? -ne 0 ]]; then
      echo "$SCRIPTNAME : $LINENO : Could not obtain global number of
processes running"
      return 1
   fi

   echo "haha"

   return 0
}

getNoGlobalProc