| 404 | } |
| 405 | |
| 406 | static cs_error_t sam_read_reply ( |
| 407 | int child_fd_in) |
| 408 | { |
| 409 | char reply; |
| 410 | cs_error_t err; |
| 411 | |
| 412 | if (sam_safe_read (sam_internal_data.child_fd_in, &reply, sizeof (reply)) != sizeof (reply)) { |
| 413 | return (CS_ERR_LIBRARY); |
| 414 | } |
| 415 | |
| 416 | switch (reply) { |
| 417 | case SAM_REPLY_ERROR: |
| 418 | /* |
| 419 | * Read error and return that |
| 420 | */ |
| 421 | if (sam_safe_read (sam_internal_data.child_fd_in, &err, sizeof (err)) != sizeof (err)) { |
| 422 | return (CS_ERR_LIBRARY); |
| 423 | } |
| 424 | |
| 425 | return (err); |
| 426 | break; |
| 427 | case SAM_REPLY_OK: |
| 428 | /* |
| 429 | * Everything correct |
| 430 | */ |
| 431 | break; |
| 432 | default: |
| 433 | return (CS_ERR_LIBRARY); |
| 434 | break; |
| 435 | } |
| 436 | |
| 437 | return (CS_OK); |
| 438 | } |
| 439 | |
| 440 | cs_error_t sam_data_getsize (size_t *size) |
| 441 | { |
no test coverage detected