svn commit: r256355 - projects/zfsd/head/cddl/sbin/zfsd
Alan Somers
asomers at FreeBSD.org
Fri Oct 11 22:00:55 UTC 2013
Author: asomers
Date: Fri Oct 11 22:00:54 2013
New Revision: 256355
URL: http://svnweb.freebsd.org/changeset/base/256355
Log:
Modify the parsing of device control attach and detach events to tolerate
the timestamp key<=>value pair added to all events in changeset 256353.
cddl/sbin/zfsd/dev_ctl_event.cc:
o In DevCtlEvent::ParseEventString(), remove code that verified that
attach and detach events contained no trailing key<=>value pairs
after the "parent" field.
o Fix whitespace/style error in an if statement.
Submitted by: gibbs
Approved by: ken (mentor)
Sponsored By: Spectra Logic Corporation
Modified:
projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc
Modified: projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc
==============================================================================
--- projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc Fri Oct 11 21:55:12 2013 (r256354)
+++ projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc Fri Oct 11 22:00:54 2013 (r256355)
@@ -256,7 +256,7 @@ DevCtlEvent::GetTimestamp() const
timeval tv_timestamp;
struct tm tm_timestamp;
- if ( ! Contains("timestamp") ) {
+ if (!Contains("timestamp")) {
throw ZfsdException("Event contains no timestamp: %s",
m_eventString.c_str());
}
@@ -320,17 +320,6 @@ DevCtlEvent::ParseEventString(DevCtlEven
start += 4;
end = eventString.find_first_of(" \t\n", start);
nvpairs["parent"] = eventString.substr(start, end);
- if (end == string::npos)
- break;
-
- /*
- * The parent field should terminate the event with the
- * exception of trailing whitespace.
- */
- end = eventString.find_first_not_of(" \t\n", end);
- if (end != string::npos)
- throw ParseException(ParseException::INVALID_FORMAT,
- end);
break;
case NOTIFY:
break;
More information about the svn-src-projects
mailing list