IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11396


Ignore:
Timestamp:
Jan 29, 2007, 2:05:16 PM (19 years ago)
Author:
jhoblitt
Message:

change pmConfigConvertFilename() to create empty files for path:// & file:// as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfig.c

    r11296 r11396  
    44 *  @author EAM (IfA)
    55 *
    6  *  @version $Revision: 1.75 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-01-26 00:21:11 $
     6 *  @version $Revision: 1.76 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-01-30 00:05:16 $
    88 *
    99 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222#include <sys/types.h>
    2323#include <sys/stat.h>
     24#include <fcntl.h>
    2425#include <glob.h>
    2526#include <pslib.h>
     
    10701071        newName = tmpName;
    10711072
     1073        // open the to create it if it doesn't exist.  This could cause a
     1074        // strange looking error if we can't access the file.
     1075        // XXX perhaps we should try access() first? -JH
     1076        int fd = open(newName, O_RDONLY|O_CREAT);
     1077        if (fd < 0) {
     1078            psError(PS_ERR_IO, true, "unable to open() file %s", newName);
     1079            psFree(newName);
     1080            return NULL;
     1081        }
     1082        if (close(fd) < 0) {
     1083            psError(PS_ERR_IO, true, "unable to open() file %s", newName);
     1084            psFree(newName);
     1085            return NULL;
     1086        }
     1087
    10721088        return newName;
    10731089    }
     
    11131129        newName = tmpName;
    11141130
     1131        // open the to create it if it doesn't exist.  This could cause a
     1132        // strange looking error if we can't access the file.
     1133        // XXX perhaps we should try access() first? -JH
     1134        int fd = open(newName, O_RDONLY|O_CREAT);
     1135        if (fd < 0) {
     1136            psError(PS_ERR_IO, true, "unable to open() file %s", newName);
     1137            psFree(newName);
     1138            return NULL;
     1139        }
     1140        if (close(fd) < 0) {
     1141            psError(PS_ERR_IO, true, "unable to open() file %s", newName);
     1142            psFree(newName);
     1143            return NULL;
     1144        }
     1145
    11151146        return newName;
    11161147    }
Note: See TracChangeset for help on using the changeset viewer.