Changeset 4778 for vtkvis/branches/1.7/RenderServer.cpp
- Timestamp:
- Nov 23, 2014, 5:51:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vtkvis/branches/1.7/RenderServer.cpp
r4606 r4778 220 220 VtkVis::getStatsFile(Tcl_Interp *interp, Tcl_Obj *objPtr) 221 221 { 222 Tcl_DString ds;223 222 Tcl_Obj **objv; 224 223 int objc; 225 224 int i; 226 225 char fileName[33]; 227 const char *path;228 226 md5_state_t state; 229 227 md5_byte_t digest[16]; … … 247 245 sprintf(fileName + i * 2, "%02x", digest[i]); 248 246 } 249 Tcl_DStringInit(&ds); 250 Tcl_DStringAppend(&ds, STATSDIR, -1); 251 Tcl_DStringAppend(&ds, "/", 1); 252 Tcl_DStringAppend(&ds, fileName, 32); 253 path = Tcl_DStringValue(&ds); 254 255 g_statsFile = open(path, O_EXCL | O_CREAT | O_WRONLY, 0600); 247 std::ostringstream oss; 248 oss << STATSDIR << "/" << fileName; 249 std::string pathStr = oss.str(); 250 251 g_statsFile = open(pathStr.c_str(), O_EXCL | O_CREAT | O_WRONLY, 0600); 256 252 Tcl_DStringFree(&ds); 257 253 if (g_statsFile < 0) { 258 ERROR("can't open \"%s\": %s", fileName, strerror(errno));254 ERROR("can't open \"%s\": %s", pathStr.c_str(), strerror(errno)); 259 255 return -1; 260 256 }
Note: See TracChangeset
for help on using the changeset viewer.