mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-13 21:29:45 +08:00
parent
d5fdfbb77a
commit
cb01e5b2a1
@ -1269,6 +1269,13 @@ pcap_loop_wrapper(pcap_t *pd, int cnt, pcap_handler cb, u_char *ud)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define pcap_loop(pd, cnt, cb, ud) pcap_loop_wrapper(pd, cnt, cb, ud)
|
#define pcap_loop(pd, cnt, cb, ud) pcap_loop_wrapper(pd, cnt, cb, ud)
|
||||||
|
|
||||||
|
static void
|
||||||
|
destroy_pcap_dumper(void *arg)
|
||||||
|
{
|
||||||
|
|
||||||
|
pcap_dump_close(arg);
|
||||||
|
}
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
int
|
int
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
@ -2125,6 +2132,12 @@ main(int argc, char **argv)
|
|||||||
if (Uflag)
|
if (Uflag)
|
||||||
pcap_dump_flush(p);
|
pcap_dump_flush(p);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __rtems__
|
||||||
|
if (rtems_bsd_program_add_destructor(destroy_pcap_dumper, p) ==
|
||||||
|
NULL) {
|
||||||
|
error("cannot add destructor");
|
||||||
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
} else {
|
} else {
|
||||||
dlt = pcap_datalink(pd);
|
dlt = pcap_datalink(pd);
|
||||||
ndo->ndo_if_printer = get_if_printer(ndo, dlt);
|
ndo->ndo_if_printer = get_if_printer(ndo, dlt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user