]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw_lc: avoid an extra newline while logging lifecycle
authorAbhishek Lekshmanan <abhishek@suse.com>
Wed, 19 Jul 2017 13:22:10 +0000 (15:22 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 19 Jul 2017 17:44:59 +0000 (19:44 +0200)
Since `ctime_r` adds a newline we would end up getting an empty newline,
use the asctime helper from rgw_common instead.

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_lc.cc

index 1d91df58ce5a80e67f9ec2aca6a353e55502ece6..2990bff1e816c1fd5269659db91dc08f3f0ea64c 100644 (file)
@@ -147,10 +147,10 @@ void *RGWLC::LCWorker::entry() {
 
     utime_t end = ceph_clock_now();
     int secs = schedule_next_start_time(start, end);
-    time_t next_time = end + secs;
-    char buf[30];
-    char *nt = ctime_r(&next_time, buf);
-    dout(5) << "schedule life cycle next start time: " << nt <<dendl;
+    utime_t next;
+    next.set_from_double(end + secs);
+
+    dout(5) << "schedule life cycle next start time: " << rgw_to_asctime(next) <<dendl;
 
     lock.Lock();
     cond.WaitInterval(lock, utime_t(secs, 0));