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

Function NameCmd

tools/ngctl/name.c:57–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57static int
58NameCmd(int ac, char **av)
59{
60 struct ngm_name name;
61 char *path;
62
63 /* Get arguments */
64 switch (ac) {
65 case 3:
66 path = av[1];
67 snprintf(name.name, sizeof(name.name), "%s", av[2]);
68 break;
69 default:
70 return (CMDRTN_USAGE);
71 }
72
73 /* Send message */
74 if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE,
75 NGM_NAME, &name, sizeof(name)) < 0) {
76 warn("send msg");
77 return (CMDRTN_ERROR);
78 }
79 return (CMDRTN_OK);
80}
81

Callers

nothing calls this directly

Calls 2

snprintfFunction · 0.85
NgSendMsgFunction · 0.85

Tested by

no test coverage detected