Changeset 5834:22e75d31bfd8 in roaraudio for libroar/roardl.c
- Timestamp:
- 01/06/13 19:56:21 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/roardl.c
r5823 r5834 59 59 void * global_data_state; 60 60 struct roar_notify_core * notifycore; 61 struct roar_vio_calls * stdvios[3]; 61 62 } context; 62 63 unsigned int runtime_flags; … … 357 358 struct roar_dl_lhandle * ret = NULL; 358 359 #if defined(ROAR_HAVE_H_DLFCN) 359 #ifdef RTLD_DEEPBIND 360 #if defined(RTLD_DEEPBIND) && 0 361 // FIXME: this is current disabled. See #296. 360 362 int libdl_flags = RTLD_DEEPBIND; 361 363 #else … … 421 423 422 424 ret->para = para; 425 426 if ( roar_vio_ref(roar_stdin) == 0 ) 427 ret->context.stdvios[0] = roar_stdin; 428 if ( roar_vio_ref(roar_stdout) == 0 ) 429 ret->context.stdvios[1] = roar_stdout; 430 if ( roar_vio_ref(roar_stderr) == 0 ) 431 ret->context.stdvios[2] = roar_stderr; 423 432 424 433 if ( ra_init ) { … … 433 442 FreeLibrary(ret->handle); 434 443 #endif 444 roar_vio_unref(ret->context.stdvios[0]); 445 roar_vio_unref(ret->context.stdvios[1]); 446 roar_vio_unref(ret->context.stdvios[2]); 435 447 roar_mm_free(ret); 436 448 roar_error = err; … … 501 513 ret = -1; 502 514 #endif 515 516 roar_vio_unref(lhandle->context.stdvios[0]); 517 roar_vio_unref(lhandle->context.stdvios[1]); 518 roar_vio_unref(lhandle->context.stdvios[2]); 503 519 504 520 if ( lhandle->context.global_data != NULL ) … … 726 742 } 727 743 744 static inline void __swap_stdvios(struct roar_dl_lhandle * lhandle) { 745 struct roar_vio_calls * vio; 746 747 vio = roar_stdin; 748 roar_stdin = lhandle->context.stdvios[0]; 749 lhandle->context.stdvios[0] = vio; 750 vio = roar_stdout; 751 roar_stdout = lhandle->context.stdvios[1]; 752 lhandle->context.stdvios[1] = vio; 753 vio = roar_stderr; 754 roar_stderr = lhandle->context.stdvios[2]; 755 lhandle->context.stdvios[2] = vio; 756 } 757 728 758 int roar_dl_context_restore(struct roar_dl_lhandle * lhandle) { 729 759 struct roar_error_state error_state; … … 740 770 roar_err_restore(&(lhandle->context.error_state)); 741 771 lhandle->context.error_state = error_state; 772 773 __swap_stdvios(lhandle); 742 774 743 775 if ( lhandle->lib->global_data_pointer != NULL ) { … … 777 809 *(lhandle->lib->global_data_pointer) = lhandle->context.global_data_state; 778 810 } 811 812 __swap_stdvios(lhandle); 779 813 780 814 roar_err_store(&error_state);
Note: See TracChangeset
for help on using the changeset viewer.