From 5f018c9147685536eb56456536a9ddaa993a308f Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Tue, 23 Jun 2020 16:29:59 +0000 Subject: [PATCH] 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) MFC after: 3 days Sponsored by: iXsystems, Inc. --- lib/libdevdctl/event.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libdevdctl/event.cc b/lib/libdevdctl/event.cc index c73c40c1c13..36c9b725fed 100644 --- a/lib/libdevdctl/event.cc +++ b/lib/libdevdctl/event.cc @@ -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];