MCPcopy Create free account
hub / github.com/acl-dev/acl / proctl_monitor_cmd_start

Function proctl_monitor_cmd_start

lib_acl/src/proctl/proctl_monitor.c:122–157  ·  view source on GitHub ↗

֪ͨ���̣߳�����һ������ */

Source from the content-addressed store, hash-verified

120
121/* ֪ͨ���̣߳�����һ������ */
122static int proctl_monitor_cmd_start(ACL_VSTREAM *client,
123 const char *filepath, const char *args)
124{
125 const char *myname = "proctl_monitor_cmd_start";
126 ACL_VSTRING *cmdline;
127 PROCTL_SERVICE *service;
128 PROCTL_MSG *msg;
129
130 if (filepath[0] == 0) {
131 acl_vstream_fprintf(client, "-ERR|filepath null\r\n");
132 acl_msg_error("%s(%d): no filepath", myname, __LINE__);
133 return (-1);
134 }
135
136 if (proctl_service_exist(filepath)) {
137 acl_msg_error("%s(%d): child(%s) maybe be running!",
138 myname, __LINE__, filepath);
139 acl_vstream_fprintf(client, "-ERR|child(%s) maybe be running!\r\n",
140 filepath);
141 return (-1);
142 }
143
144 cmdline = acl_vstring_alloc(256);
145 acl_vstring_strcpy(cmdline, "\"");
146 acl_vstring_strcat(cmdline, filepath);
147 acl_vstring_strcat(cmdline, "\"");
148 if (args && *args) {
149 acl_vstring_strcat(cmdline, " ");
150 acl_vstring_strcat(cmdline, args);
151 }
152 service = proctl_service_alloc(filepath, cmdline);
153 msg = proctl_msg_new(PROCTL_MSG_START);
154 msg->service = service;
155 proctl_msg_push(msg);
156 return (0);
157}
158
159/* ֹͣ���еķ��񣬲��˳��������ƽ��� */
160static void proctl_monitor_cmd_quit(ACL_VSTREAM *client)

Callers 1

proctl_monitor_mainFunction · 0.85

Calls 9

acl_vstream_fprintfFunction · 0.85
acl_msg_errorFunction · 0.85
proctl_service_existFunction · 0.85
acl_vstring_allocFunction · 0.85
acl_vstring_strcpyFunction · 0.85
acl_vstring_strcatFunction · 0.85
proctl_service_allocFunction · 0.85
proctl_msg_newFunction · 0.85
proctl_msg_pushFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…