#50656 Issue 50655 - access log etime is not properly formatted
Merged 4 months ago by mreynolds. Opened 4 months ago by mreynolds.
mreynolds/389-ds-base issue50655  into  master

file modified
+2 -1

@@ -1991,7 +1991,8 @@ 

      struct timespec o_hr_time_end;

      slapi_operation_time_elapsed(op, &o_hr_time_end);

  

-     snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%010" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);

+ 

+     snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);

  

      operation_notes = slapi_pblock_get_operation_notes(pb);

  

Description:

The wrong printf format was used for displaying the nanosecond etime in the access log.

relates: https://pagure.io/389-ds-base/issue/50655

Reviewed by: ?

I think it should be .%09 because the 0 is a left-padding character when the input is < 9 which can/will happen.

rebased onto 225f4e1

4 months ago

I think it should be .%09 because the 0 is a left-padding character when the input is < 9 which can/will happen.

Yeah this seems to give the expected results. Patch has been updated...

Ack :) thanks for fixing william-of-the-pasts mistake.

Pull-Request has been merged by mreynolds

4 months ago
Metadata