Changeset 5276:0eb24ca6810e in roaraudio for libroar/vio_cmd.c
- Timestamp:
- 11/20/11 18:36:49 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vio_cmd.c
r5111 r5276 80 80 calls->read = roar_vio_cmd_read; 81 81 calls->write = roar_vio_cmd_write; 82 calls->nonblock = roar_vio_cmd_nonblock;83 82 calls->sync = roar_vio_cmd_sync; 84 83 calls->ctl = roar_vio_cmd_ctl; … … 514 513 } 515 514 516 int roar_vio_cmd_nonblock(struct roar_vio_calls * vio, int state) {517 struct roar_vio_cmd_state * self = (struct roar_vio_cmd_state *)vio->inst;518 519 self->options |= ROAR_VIO_CMD_OPTS_NONBLOCK;520 521 if ( state == ROAR_SOCKET_BLOCK )522 self->options -= ROAR_VIO_CMD_OPTS_NONBLOCK;523 524 _LIBROAR_IGNORE_RET(roar_vio_nonblock(self->next, state)); // this should help, but may not nessessery.525 526 return 0;527 }528 529 515 int roar_vio_cmd_sync (struct roar_vio_calls * vio) { 530 516 struct roar_vio_cmd_state * state = (struct roar_vio_cmd_state *)vio->inst; 517 int newblock = ROAR_SOCKET_BLOCK; 531 518 int oldblock; 532 519 int ret = 0; … … 534 521 oldblock = state->options & ROAR_VIO_CMD_OPTS_NONBLOCK ? ROAR_SOCKET_NONBLOCK : ROAR_SOCKET_BLOCK; 535 522 536 if ( roar_vio_cmd_ nonblock(vio, ROAR_SOCKET_BLOCK) == -1 )523 if ( roar_vio_cmd_ctl(vio, ROAR_VIO_CTL_NONBLOCK, &newblock) == -1 ) 537 524 return -1; 538 525 … … 543 530 ret = -1; 544 531 545 if ( roar_vio_cmd_ nonblock(vio,oldblock) == -1 )532 if ( roar_vio_cmd_ctl(vio, ROAR_VIO_CTL_NONBLOCK, &oldblock) == -1 ) 546 533 return -1; 547 534 … … 586 573 return -1; 587 574 break; 575 case ROAR_VIO_CTL_NONBLOCK: 576 state->options |= ROAR_VIO_CMD_OPTS_NONBLOCK; 577 578 if ( *(int*)data == ROAR_SOCKET_BLOCK ) 579 state->options -= ROAR_VIO_CMD_OPTS_NONBLOCK; 580 581 _LIBROAR_IGNORE_RET(roar_vio_ctl(state->next, cmd, data)); // this should help, but may not necessarily. 582 break; 588 583 default: 589 584 return -1;
Note: See TracChangeset
for help on using the changeset viewer.