Changeset 467d2b9 in mainline for uspace/lib/pcap/src/pcap_dumper.c


Ignore:
Timestamp:
2024-12-13T08:44:05Z (14 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
e1e8f7a
Parents:
f161ce1
git-author:
Nataliia Korop <n.corop08@…> (2024-11-10 18:34:17)
git-committer:
Nataliia Korop <n.corop08@…> (2024-12-13 08:44:05)
Message:

logger

File:
1 edited

Legend:

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

    rf161ce1 r467d2b9  
    3636#include <errno.h>
    3737#include <str.h>
     38#include <io/log.h>
    3839#include "pcap_dumper.h"
    3940
    4041/** Initialize writing to .pcap file.
    4142 *
    42  * @param writer    Interface for working with .pcap file
    43  * @param filename  Name of the file for dumping packets
    44  * @return          EOK on success or an error code
     43 * @param writer    Interface for working with .pcap file.
     44 * @param filename  Name of the file for dumping packets.
     45 * @return          EOK on success or an error code.
    4546 *
    4647 */
     
    126127                pcap_dumper_stop(dumper);
    127128        }
     129
    128130        errno_t rc = dumper->writer.ops->open(&dumper->writer, name);
    129131        if (rc == EOK) {
    130132                dumper->to_dump = true;
    131         } else {
    132                 printf("Failed creating pcap dumper: %s", str_error(rc));
    133         }
     133        }
     134
    134135        fibril_mutex_unlock(&dumper->mutex);
    135136        return rc;
     
    188189        dumper->to_dump = false;
    189190        dumper->writer.ops = NULL;
     191
     192        errno_t rc = log_init("pcap");
     193        if (rc != EOK) {
     194                printf("pcap : Failed to initialize log.\n");
     195                return 1;
     196        }
    190197        return EOK;
    191198}
Note: See TracChangeset for help on using the changeset viewer.