MCPcopy Create free account
hub / github.com/corosync/corosync / sam_read_reply

Function sam_read_reply

lib/sam.c:406–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404}
405
406static 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
440cs_error_t sam_data_getsize (size_t *size)
441{

Callers 4

sam_data_store_nolockFunction · 0.85
sam_startFunction · 0.85
sam_stop_nolockFunction · 0.85

Calls 1

sam_safe_readFunction · 0.85

Tested by

no test coverage detected