From 5136de06062bbd08e843bd787d74def6b45996a0 Mon Sep 17 00:00:00 2001 From: SteveWare Date: Thu, 5 May 2016 20:09:57 +0100 Subject: [PATCH] Issue #3: Error handling in main for pthread_create --- replay/rdp_replay.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/replay/rdp_replay.C b/replay/rdp_replay.C index 719e55c..d85805d 100644 --- a/replay/rdp_replay.C +++ b/replay/rdp_replay.C @@ -200,7 +200,11 @@ int main(int argc, char *const *argv) pdelay.fullspeed() ; // Set pcap rate to fullspeed until we lock onto selected stream pthread_t th ; - pthread_create(&th, 0, monitor_thread, 0) ; + if (pthread_create(&th, 0, monitor_thread, 0)) + { + printf("Sorry, pthread_create failed. Aborting.\n") ; + exit(1) ; + } (void)pcap_loop(ph, 0, pcap_delay::process, (u_char *)&pdelay) ;