Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 2020 00:58:59 +0000 (UTC)
From:      Ryan Moeller <freqlabs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r362638 - in stable: 11/lib/libdevdctl 12/lib/libdevdctl
Message-ID:  <202006260058.05Q0wxSf074128@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: freqlabs
Date: Fri Jun 26 00:58:59 2020
New Revision: 362638
URL: https://svnweb.freebsd.org/changeset/base/362638

Log:
  MFC r362544:
  
  libdevdctl: Force full match of "timestamp" field name
  
  OpenZFS generates events with a "zio_timestamp" field, which gets mistaken for
  "timestamp" by libdevdctl due to imprecise string matching.  Then later it is
  assumed a "timestamp" field exists when it doesn't and an exception is thrown.
  
  Add a space to the search string so we match exactly "timestamp" rather than
  anything with that as a suffix.
  
  Approved by:    mav (mentor)
  Sponsored by:   iXsystems, Inc.

Modified:
  stable/11/lib/libdevdctl/event.cc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/lib/libdevdctl/event.cc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/lib/libdevdctl/event.cc
==============================================================================
--- stable/11/lib/libdevdctl/event.cc	Fri Jun 26 00:01:31 2020	(r362637)
+++ stable/11/lib/libdevdctl/event.cc	Fri Jun 26 00:58:59 2020	(r362638)
@@ -427,7 +427,7 @@ Event::TimestampEventString(std::string &eventString)
 		 * Add a timestamp as the final field of the event if it is
 		 * not already present.
 		 */
-		if (eventString.find("timestamp=") == string::npos) {
+		if (eventString.find(" timestamp=") == string::npos) {
 			const size_t bufsize = 32;	// Long enough for a 64-bit int
 			timeval now;
 			char timebuf[bufsize];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006260058.05Q0wxSf074128>