mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
initctl: Fix broken presentation of inetd services in verbose mode.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
59731988fd
commit
ac0edc9b37
1 file changed
+9
-2
@@ -113,13 +113,20 @@ static int do_restart(char *buf, size_t len) { return call(service_restart, buf,
|
|||||||
|
|
||||||
static int do_query_inetd(char *buf, size_t len)
|
static int do_query_inetd(char *buf, size_t len)
|
||||||
{
|
{
|
||||||
char *input = sanitize(buf, len);
|
int id = 1;
|
||||||
|
char *ptr, *input = sanitize(buf, len);
|
||||||
svc_t *svc;
|
svc_t *svc;
|
||||||
|
|
||||||
if (!input)
|
if (!input)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
svc = svc_find_by_jobid(atonum(input), 1);
|
ptr = strchr(input, ':');
|
||||||
|
if (ptr) {
|
||||||
|
*ptr++ = 0;
|
||||||
|
id = atonum(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
svc = svc_find_by_jobid(atonum(input), id);
|
||||||
if (!svc || !svc_is_inetd(svc)) {
|
if (!svc || !svc_is_inetd(svc)) {
|
||||||
_e("Cannot %s svc %s ...", !svc ? "find" : "query, not an inetd", input);
|
_e("Cannot %s svc %s ...", !svc ? "find" : "query, not an inetd", input);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in new issue
Block a user