Changeset 5834:22e75d31bfd8 in roaraudio
- Timestamp:
- 01/06/13 19:56:21 (10 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5814 r5834 6 6 * Made build system tests return correct error codes. 7 7 * Improved CSI: Make it easier to register and access services. 8 * Allow seperation of plugin's stdvios (See: #296) 8 9 9 10 v. 1.0beta8 - Mon Dec 10 2012 12:42 CET -
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); -
libroar/vio.c
r5823 r5834 218 218 int roar_vio_unref (struct roar_vio_calls * vio) { 219 219 int ret; 220 int err; 220 221 221 222 ROAR_DBG("roar_vio_unref(vio=%p) = ?", vio); … … 240 241 roar_err_update(); 241 242 242 if ( vio->flags & ROAR_VIO_FLAGS_FREESELF ) 243 err = roar_error; 244 245 if ( vio->flags & ROAR_VIO_FLAGS_FREESELF ) { 246 roar_vio_clear_calls(vio); 243 247 roar_mm_free(vio); 244 248 } else { 249 roar_vio_clear_calls(vio); 250 } 251 252 roar_error = err; 245 253 return ret; 246 254 } -
libroar/vio_stdvios.c
r5823 r5834 39 39 { .inst = (void*)(ROAR_INSTINT)(ROAR_STDIN + 1), 40 40 .flags = 0x00000000, 41 .refc = 0,41 .refc = 1, 42 42 .read = roar_vio_basic_read, 43 43 .write = roar_vio_basic_write, … … 49 49 { .inst = (void*)(ROAR_INSTINT)(ROAR_STDOUT + 1), 50 50 .flags = 0x00000000, 51 .refc = 0,51 .refc = 1, 52 52 .read = roar_vio_basic_read, 53 53 .write = roar_vio_basic_write, … … 59 59 { .inst = (void*)(ROAR_INSTINT)(ROAR_STDERR + 1), 60 60 .flags = 0x00000000, 61 .refc = 0,61 .refc = 1, 62 62 .read = roar_vio_basic_read, 63 63 .write = roar_vio_basic_write,
Note: See TracChangeset
for help on using the changeset viewer.