Ticket #1436: alwaystimestamp.patch

File alwaystimestamp.patch, 2.4 KB (added by Michael Schneider, 22 months ago)

Patch based on #5199

  • ataprint.cpp

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: /home/hal/NetBeansProjects/smartmontools-code/smartmontools
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    802802  time_t now = time(0);
    803803  char timedatetz[DATEANDEPOCHLEN]; dateandtimezoneepoch(timedatetz, now);
    804804  jout("Local Time is:    %s\n", timedatetz);
    805   jglb["local_time"]["time_t"] = now;
    806   jglb["local_time"]["asctime"] = timedatetz;
    807805
    808806  // Print warning message, if there is one
    809807  if (dbentry && *dbentry->warningmsg)
  • nvmeprint.cpp

     
    202202  }
    203203
    204204  time_t now = time(0);
    205   char td[DATEANDEPOCHLEN]; dateandtimezoneepoch(td, now);
    206   jout("Local Time is:                      %s\n", td);
    207   jglb["local_time"]["time_t"] = now;
    208   jglb["local_time"]["asctime"] = td;
     205  char timedatetz[DATEANDEPOCHLEN]; dateandtimezoneepoch(timedatetz, now);
     206  jout("Local Time is:                      %s\n", timedatetz);
    209207}
    210208
    211209// Format scaled power value.
  • scsiprint.cpp

     
    21352135    time_t now = time(0);
    21362136    char timedatetz[DATEANDEPOCHLEN]; dateandtimezoneepoch(timedatetz, now);
    21372137    jout("Local Time is:        %s\n", timedatetz);
    2138     jglb["local_time"]["time_t"] = now;
    2139     jglb["local_time"]["asctime"] = timedatetz;
    21402138
    21412139    // See if unit accepts SCSI commands from us
    21422140    if ((err = scsiTestUnitReady(device))) {
  • smartctl.cpp

     
    16531653    if (jglb.has_uint128_output())
    16541654      jglb["smartctl"]["uint128_precision_bits"] = uint128_to_str_precision_bits();
    16551655    jglb["smartctl"]["exit_status"] = status;
     1656    // print current time and date and timezone
     1657    time_t now = time(0);
     1658    char timedatetz[DATEANDEPOCHLEN]; dateandtimezoneepoch(timedatetz, now);
     1659    jglb["local_time"]["time_t"] = now;
     1660    jglb["local_time"]["asctime"] = timedatetz;
    16561661    jglb.print(stdout, print_as_json_options);
    16571662  }
    16581663  catch (const std::bad_alloc & /*ex*/) {