IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8819


Ignore:
Timestamp:
Sep 15, 2006, 3:07:38 PM (20 years ago)
Author:
Paul Price
Message:

psMetadataConfigRead used the results of stat(), but didn't call stat().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadataConfig.c

    r8804 r8819  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-09-12 21:55:49 $
     12*  @version $Revision: 1.86 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-09-16 01:07:38 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11571157    PS_ASSERT_PTR_NON_NULL(filename,NULL);
    11581158
    1159     struct stat buf;
    1160 
    11611159    // Attempt to open specified file
    11621160    int fd = 0;
     
    11641162        // XXX really should return strerror() here
    11651163        psError(PS_ERR_IO, true, _("Failed to open file '%s'. Check if it exists and it has the proper permissions."), filename);
     1164        return NULL;
     1165    }
     1166
     1167    struct stat buf;                    // Results of stat() for file
     1168    if (fstat(fd, &buf) != 0) {
     1169        psError(PS_ERR_IO, true, _("Unable to stat file '%s'.\n"), filename);
     1170        close(fd);
    11661171        return NULL;
    11671172    }
Note: See TracChangeset for help on using the changeset viewer.