Whamcloud - gitweb
LU-4725 obd: lu_object_find_at hung
[fs/lustre-release.git] / libsysio / src / chdir.c
index c943d8f..3f5c900 100644 (file)
@@ -9,7 +9,7 @@
  *    terms of the GNU Lesser General Public License
  *    (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
  *
- *    Cplant(TM) Copyright 1998-2003 Sandia Corporation. 
+ *    Cplant(TM) Copyright 1998-2006 Sandia Corporation. 
  *    Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
  *    license for use of this work by or on behalf of the US Government.
  *    Export of this program may require a license from the United States
@@ -79,7 +79,7 @@
 #include "file.h"
 #include "sysio-symbols.h"
 
-#if DEFER_INIT_CWD
+#ifdef DEFER_INIT_CWD
 const char *_sysio_init_cwd = NULL;
 #endif
 
@@ -101,10 +101,8 @@ _sysio_p_chdir(struct pnode *pno)
                return err;
        if (!(pno->p_base->pb_ino &&
              S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode)))
-               err = -ENOTDIR;
-       else
-               err = _sysio_permitted(pno->p_base->pb_ino, X_OK);
-       if (err)
+               return -ENOTDIR;
+       if ((err = _sysio_permitted(pno, X_OK)) != 0)
                return err;
 
        /*
@@ -242,7 +240,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size)
        SYSIO_INTERFACE_DISPLAY_BLOCK;
 
        SYSIO_INTERFACE_ENTER;
-#if DEFER_INIT_CWD
+#ifdef DEFER_INIT_CWD
        if (!_sysio_cwd) {
                struct pnode *pno;