This function is called by the child rewriting the AOF file to read * the difference accumulated from the parent into a buffer, that is * concatenated at the end of the rewrite. */
| 1536 | * the difference accumulated from the parent into a buffer, that is |
| 1537 | * concatenated at the end of the rewrite. */ |
| 1538 | ssize_t aofReadDiffFromParent(void) { |
| 1539 | char buf[65536]; /* Default pipe buffer size on most Linux systems. */ |
| 1540 | ssize_t nread, total = 0; |
| 1541 | |
| 1542 | while ((nread = |
| 1543 | read(g_pserver->aof_pipe_read_data_from_parent,buf,sizeof(buf))) > 0) { |
| 1544 | g_pserver->aof_child_diff = sdscatlen(g_pserver->aof_child_diff,buf,nread); |
| 1545 | total += nread; |
| 1546 | } |
| 1547 | return total; |
| 1548 | } |
| 1549 | |
| 1550 | int rewriteAppendOnlyFileRio(rio *aof) { |
| 1551 | size_t processed = 0; |
no test coverage detected