Changeset 3551

Show
Ignore:
Timestamp:
10/20/2009 02:39:22 PM (1 month ago)
Author:
brian
Message:

Report EISDIR error code correctly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • XrdHdfs/XrdHdfs.cc

    r3536 r3551  
    273273   int err_code = 0; 
    274274 
    275    if ((fh = hdfsOpenFile(fs, path, open_flag, 0, 0, 0)) == NULL) 
    276       { 
     275   if ((fh = hdfsOpenFile(fs, path, open_flag, 0, 0, 0)) == NULL) { 
    277276       err_code = errno; 
    278        if (errno == EEXIST) 
    279           { 
    280            hdfsFileInfo * fileInfo = hdfsGetPathInfo(fs, path); 
    281            if (fileInfo != NULL) { 
    282                if (fileInfo->mKind == kObjectKindDirectory) { 
     277       hdfsFileInfo * fileInfo = hdfsGetPathInfo(fs, path); 
     278       if (fileInfo != NULL) { 
     279           if (fileInfo->mKind == kObjectKindDirectory) { 
    283280                   err_code = EISDIR; 
    284                } 
    285                hdfsFreeFileInfo(fileInfo, 1); 
    286281           } 
    287           } 
    288       } 
     282           hdfsFreeFileInfo(fileInfo, 1); 
     283       } else {  
     284           err_code = EEXIST; 
     285       } 
     286   } 
    289287 
    290288// All done.