Changeset a270026 in mainline for uspace/lib/pcap/src/pcap.c


Ignore:
Timestamp:
2024-12-13T08:32:55Z (10 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
2dac5a9
Parents:
9eb21d1
git-author:
Nataliia Korop <n.corop08@…> (2024-02-19 06:27:40)
git-committer:
Nataliia Korop <n.corop08@…> (2024-12-13 08:32:55)
Message:

small typos and ccheck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcap/src/pcap.c

    r9eb21d1 ra270026  
    5252void pcap_set_time(pcap_packet_header_t *header, bool nano) // maybe without bool nano as nano is in pcapng
    5353{
    54         time_t sec = time(NULL);
    55         header->seconds_stamp = (uint32_t)sec;
    56         header->magic_stamp = nano ? header->seconds_stamp / 1000000000 : header->seconds_stamp / 1000000;
     54        struct timespec ts;
     55        getrealtime(&ts);
     56        header->seconds_stamp = (uint32_t)ts.tv_sec;
     57        header->magic_stamp = (uint32_t)ts.tv_nsec / 1000;
    5758}
    5859
Note: See TracChangeset for help on using the changeset viewer.