summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/invoker/filesystem
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/plugins/invoker/filesystem')
-rw-r--r--src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp
index 8489d1d..2d308ce 100644
--- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp
+++ b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp
@@ -116,13 +116,13 @@ void DirMonInvoker::handleFileAction(FW::WatchID watchid, const FW::String& dir,
break;
}
- event.compound["file"].compound["name"] = Data(filename, Data::VERBATIM);
- event.compound["file"].compound["dir"] = Data(dir, Data::VERBATIM);
+ event.data.compound["file"].compound["name"] = Data(filename, Data::VERBATIM);
+ event.data.compound["file"].compound["dir"] = Data(dir, Data::VERBATIM);
- event.compound["file"].compound["mtime"] = toStr(fileStat.st_mtime);
- event.compound["file"].compound["ctime"] = toStr(fileStat.st_ctime);
- event.compound["file"].compound["atime"] = toStr(fileStat.st_atime);
- event.compound["file"].compound["size"] = toStr(fileStat.st_size);
+ event.data.compound["file"].compound["mtime"] = toStr(fileStat.st_mtime);
+ event.data.compound["file"].compound["ctime"] = toStr(fileStat.st_ctime);
+ event.data.compound["file"].compound["atime"] = toStr(fileStat.st_atime);
+ event.data.compound["file"].compound["size"] = toStr(fileStat.st_size);
returnEvent(event);
}
@@ -158,8 +158,8 @@ void DirMonInvoker::reportExistingIn(const std::string dir, FW::WatchID watchid)
if (boost::iequals(dname, ".") || boost::iequals(dname, ".."))
continue;
- char* filename;
- asprintf(&filename, "%s/%s", dir.c_str(), dname.c_str());
+ char* filename = (char*)malloc(dir.size() + dname.size() + 2);
+ sprintf(filename, "%s/%s", dir.c_str(), dname.c_str());
struct stat fileStat;
if (stat(filename, &fileStat) != 0) {