Changeset 11396 for trunk/psModules/src/config/pmConfig.c
- Timestamp:
- Jan 29, 2007, 2:05:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r11296 r11396 4 4 * @author EAM (IfA) 5 5 * 6 * @version $Revision: 1.7 5$ $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 $ 8 8 * 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include <sys/types.h> 23 23 #include <sys/stat.h> 24 #include <fcntl.h> 24 25 #include <glob.h> 25 26 #include <pslib.h> … … 1070 1071 newName = tmpName; 1071 1072 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 1072 1088 return newName; 1073 1089 } … … 1113 1129 newName = tmpName; 1114 1130 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 1115 1146 return newName; 1116 1147 }
Note:
See TracChangeset
for help on using the changeset viewer.
