Changeset 13346 for trunk/psModules/src/config/pmConfig.c
- Timestamp:
- May 10, 2007, 5:40:18 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r13207 r13346 4 4 * @author EAM (IfA) 5 5 * 6 * @version $Revision: 1.9 2$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-05- 04 00:46:42$6 * @version $Revision: 1.93 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-05-11 03:40:18 $ 8 8 * 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1087 1087 newName = tmpName; 1088 1088 1089 // open the to create it if it doesn't exist. This could cause a 1090 // strange looking error if we can't access the file. 1091 // XXX perhaps we should try access() first? -JH 1092 int fd = open(newName, O_RDONLY|O_CREAT); 1093 if (fd < 0) { 1094 psError(PS_ERR_IO, true, "unable to open() file %s", newName); 1095 psFree(newName); 1096 return NULL; 1097 } 1098 if (close(fd) < 0) { 1099 psError(PS_ERR_IO, true, "unable to open() file %s", newName); 1089 if (!create && access(newName, R_OK) != 0) { 1090 psError(PS_ERR_IO, true, "Unable to access file %s", newName); 1100 1091 psFree(newName); 1101 1092 return NULL; … … 1145 1136 newName = tmpName; 1146 1137 1147 // open the to create it if it doesn't exist. This could cause a 1148 // strange looking error if we can't access the file. 1149 // XXX perhaps we should try access() first? -JH 1150 int fd = open(newName, O_RDONLY|O_CREAT); 1151 if (fd < 0) { 1152 psError(PS_ERR_IO, true, "unable to open() file %s", newName); 1138 if (!create && access(newName, R_OK) != 0) { 1139 psError(PS_ERR_IO, true, "Unable to access file %s", newName); 1153 1140 psFree(newName); 1154 1141 return NULL; 1155 1142 } 1156 if (close(fd) < 0) {1157 psError(PS_ERR_IO, true, "unable to open() file %s", newName);1158 psFree(newName);1159 return NULL;1160 }1161 1162 1143 return newName; 1163 1144 }
Note:
See TracChangeset
for help on using the changeset viewer.
