Show More
@@ -239,14 +239,18 b' static void handlesystemrequest(hgclient' | |||||
239 | const char **args = unpackcmdargsnul(ctx); |
|
239 | const char **args = unpackcmdargsnul(ctx); | |
240 | if (!args[0] || !args[1] || !args[2]) |
|
240 | if (!args[0] || !args[1] || !args[2]) | |
241 | abortmsg("missing type or command or cwd in system request"); |
|
241 | abortmsg("missing type or command or cwd in system request"); | |
242 | debugmsg("run '%s' at '%s'", args[1], args[2]); |
|
242 | if (strcmp(args[0], "system") == 0) { | |
243 | int32_t r = runshellcmd(args[1], args + 3, args[2]); |
|
243 | debugmsg("run '%s' at '%s'", args[1], args[2]); | |
244 | free(args); |
|
244 | int32_t r = runshellcmd(args[1], args + 3, args[2]); | |
|
245 | free(args); | |||
245 |
|
246 | |||
246 | uint32_t r_n = htonl(r); |
|
247 | uint32_t r_n = htonl(r); | |
247 | memcpy(ctx->data, &r_n, sizeof(r_n)); |
|
248 | memcpy(ctx->data, &r_n, sizeof(r_n)); | |
248 | ctx->datasize = sizeof(r_n); |
|
249 | ctx->datasize = sizeof(r_n); | |
249 | writeblock(hgc); |
|
250 | writeblock(hgc); | |
|
251 | } else { | |||
|
252 | abortmsg("unknown type in system request: %s", args[0]); | |||
|
253 | } | |||
250 | } |
|
254 | } | |
251 |
|
255 | |||
252 | /* Read response of command execution until receiving 'r'-esult */ |
|
256 | /* Read response of command execution until receiving 'r'-esult */ |
General Comments 0
You need to be logged in to leave comments.
Login now