Open a child-parent channel used in order to move information about the * RDB / AOF saving process from the child to the parent (for instance * the amount of copy on write memory used) */
| 42 | * RDB / AOF saving process from the child to the parent (for instance |
| 43 | * the amount of copy on write memory used) */ |
| 44 | void openChildInfoPipe(void) { |
| 45 | serverAssert(g_pserver->child_info_pipe[0] == -1); |
| 46 | if (pipe(g_pserver->child_info_pipe) == -1) { |
| 47 | /* On error our two file descriptors should be still set to -1, |
| 48 | * but we call anyway closeChildInfoPipe() since can't hurt. */ |
| 49 | closeChildInfoPipe(); |
| 50 | } else if (anetNonBlock(NULL,g_pserver->child_info_pipe[0]) != ANET_OK) { |
| 51 | closeChildInfoPipe(); |
| 52 | } else { |
| 53 | g_pserver->child_info_nread = 0; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /* Close the pipes opened with openChildInfoPipe(). */ |
| 58 | void closeChildInfoPipe(void) { |
no test coverage detected