MCPcopy Create free account
hub / github.com/F-Stack/f-stack / knictl_status

Function knictl_status

tools/knictl/knictl.c:47–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47int knictl_status(struct ff_knictl_args *knictl){
48 int ret;
49 struct ff_msg *msg, *retmsg = NULL;
50
51 msg = ff_ipc_msg_alloc();
52 if (msg == NULL) {
53 errno = ENOMEM;
54 return -1;
55 }
56
57 msg->msg_type = FF_KNICTL;
58 msg->knictl = *knictl;
59 ret = ff_ipc_send(msg);
60 if (ret < 0) {
61 errno = EPIPE;
62 ff_ipc_msg_free(msg);
63 return -1;
64 }
65
66 do {
67 if (retmsg != NULL) {
68 ff_ipc_msg_free(retmsg);
69 }
70
71 ret = ff_ipc_recv(&retmsg, msg->msg_type);
72 if (ret < 0) {
73 errno = EPIPE;
74 ff_ipc_msg_free(msg);
75 return -1;
76 }
77 } while (msg != retmsg);
78
79 *knictl = retmsg->knictl;
80
81 ff_ipc_msg_free(msg);
82
83 return 0;
84}
85
86int main(int argc, char **argv)
87{

Callers 1

mainFunction · 0.85

Calls 4

ff_ipc_msg_allocFunction · 0.85
ff_ipc_sendFunction · 0.85
ff_ipc_msg_freeFunction · 0.85
ff_ipc_recvFunction · 0.85

Tested by

no test coverage detected