diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-13 17:04:54 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-13 17:04:54 (GMT) |
commit | 5342ef51367116726454ebdbd4bc27f0de3354b2 (patch) | |
tree | 506ee7b8ce873b6024baf59b3cafecc4fb3c9770 /src/uscxml/plugins/invoker | |
parent | f52a7dce4ada921094ab6bff7df7faa81d7a3924 (diff) | |
download | uscxml-5342ef51367116726454ebdbd4bc27f0de3354b2.zip uscxml-5342ef51367116726454ebdbd4bc27f0de3354b2.tar.gz uscxml-5342ef51367116726454ebdbd4bc27f0de3354b2.tar.bz2 |
Windows port compiles again
Diffstat (limited to 'src/uscxml/plugins/invoker')
-rw-r--r-- | src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp index b2a16f3..882c174 100644 --- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp +++ b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp @@ -275,23 +275,21 @@ void DirectoryWatch::updateEntries(bool reportAsExisting) { hFind = FindFirstFile(szDir, &ffd); do { - string dname = ffd.cFileName; + std::string dname = ffd.cFileName; #endif // see if the file was changed - char* filename; - asprintf(&filename, "%s/%s", (_dir + _relDir).c_str(), dname.c_str()); + std::string filename = _dir + _relDir + "/" + dname; +// asprintf(&filename, "%s/%s", (_dir + _relDir).c_str(), dname.c_str()); struct stat fileStat; - if (stat(filename, &fileStat) != 0) { + if (stat(filename.c_str(), &fileStat) != 0) { LOG(ERROR) << "Error with stat on directory entry: " << filename << ": " << strerror(errno); - free(filename); continue; } if (fileStat.st_mode & S_IFDIR) { if (boost::equals(dname, ".") || boost::equals(dname, "..")) { - free(filename); continue; // do not report . or .. } } @@ -330,7 +328,6 @@ void DirectoryWatch::updateEntries(bool reportAsExisting) { } } - free(filename); _knownEntries[dname] = fileStat; // gets copied on insertion #ifndef WIN32 } |