Fix service_started_daemon, bug #11
This commit is contained in:
parent
ae6929fa30
commit
9ce3086bf5
@ -431,7 +431,7 @@ bool rc_service_started_daemon (const char *service, const char *exec,
|
|||||||
} else {
|
} else {
|
||||||
if ((dp = opendir (dirpath))) {
|
if ((dp = opendir (dirpath))) {
|
||||||
while ((d = readdir (dp))) {
|
while ((d = readdir (dp))) {
|
||||||
if (d->d_name[0] == ',')
|
if (d->d_name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
retval = _match_daemon (dirpath, d->d_name, mexec, NULL, NULL);
|
retval = _match_daemon (dirpath, d->d_name, mexec, NULL, NULL);
|
||||||
if (retval)
|
if (retval)
|
||||||
|
@ -229,11 +229,14 @@ static int do_service (int argc, char **argv)
|
|||||||
|
|
||||||
service = getenv ("SVCNAME");
|
service = getenv ("SVCNAME");
|
||||||
if (argc > 3) {
|
if (argc > 3) {
|
||||||
service = argv[0];
|
service = argv[1];
|
||||||
d = argv[2];
|
d = argv[2];
|
||||||
sscanf (argv[3], "%d", &idx);
|
sscanf (argv[3], "%d", &idx);
|
||||||
} else if (argc == 3) {
|
} else if (argc == 3) {
|
||||||
sscanf (argv[2], "%d", &idx);
|
if (sscanf (argv[2], "%d", &idx) != 1) {
|
||||||
|
service = argv[1];
|
||||||
|
d = argv[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit (rc_service_started_daemon (service, d, idx) ? 0 : 1);
|
exit (rc_service_started_daemon (service, d, idx) ? 0 : 1);
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user