diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2001-10-03 17:15:43 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2001-10-03 17:15:43 +0000 |
commit | 70564011218ab5eef38842412af9313b2a133f69 (patch) | |
tree | dda4a4296e74ddb4c07c14aa7eea471eef9bbe15 /src/input/input_rtp.c | |
parent | 2341ac8aa13c8ad994eab1fbbefe98238ed4f117 (diff) | |
download | xine-lib-70564011218ab5eef38842412af9313b2a133f69.tar.gz xine-lib-70564011218ab5eef38842412af9313b2a133f69.tar.bz2 |
Add error checks to all "pthread_create" calls, print error message and exit
xine, whenever a pthread_create fails
CVS patchset: 729
CVS date: 2001/10/03 17:15:43
Diffstat (limited to 'src/input/input_rtp.c')
-rw-r--r-- | src/input/input_rtp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c index 31dcf403d..eaebb5a8f 100644 --- a/src/input/input_rtp.c +++ b/src/input/input_rtp.c @@ -270,6 +270,7 @@ static int rtp_plugin_open (input_plugin_t *this_gen, char *mrl ) { char *pptr; int port = 7658; pthread_attr_t thread_attrs; + int err; this->mrl = mrl; @@ -309,8 +310,12 @@ static int rtp_plugin_open (input_plugin_t *this_gen, char *mrl ) { pthread_cond_init(&this->buffer_notempty, NULL); pthread_attr_init(&thread_attrs); pthread_attr_setdetachstate(&thread_attrs, PTHREAD_CREATE_DETACHED); - pthread_create(&this->reader_thread, &thread_attrs, - input_plugin_read_loop, (void *)&this); + if ((err = pthread_create(&this->reader_thread, &thread_attrs, + input_plugin_read_loop, (void *)&this)) != 0) { + fprintf (stderr, "input_rtp: can't create new thread (%s)\n", + strerror(err)); + exit (1); + } pthread_attr_destroy(&thread_attrs); return 1; |