librc: tweak style: foo () -> foo()
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
f8ff4a86a3
commit
fe18c7bb63
@ -308,10 +308,10 @@ _match_list(const char *exec, const char *const *argv, const char *pidfile)
|
|||||||
|
|
||||||
if (pidfile) {
|
if (pidfile) {
|
||||||
l = strlen(pidfile) + 9;
|
l = strlen(pidfile) + 9;
|
||||||
m = xmalloc(sizeof (char) * l);
|
m = xmalloc(sizeof(char) * l);
|
||||||
snprintf(m, l, "pidfile=%s", pidfile);
|
snprintf(m, l, "pidfile=%s", pidfile);
|
||||||
rc_stringlist_add(match, m);
|
rc_stringlist_add(match, m);
|
||||||
free (m);
|
free(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
return match;
|
return match;
|
||||||
@ -508,7 +508,7 @@ rc_service_daemons_crashed(const char *service)
|
|||||||
if ((fp = fopen(pidfile, "r"))) {
|
if ((fp = fopen(pidfile, "r"))) {
|
||||||
if (fscanf(fp, "%d", &pid) == 1)
|
if (fscanf(fp, "%d", &pid) == 1)
|
||||||
retval = false;
|
retval = false;
|
||||||
fclose (fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
free(pidfile);
|
free(pidfile);
|
||||||
pidfile = NULL;
|
pidfile = NULL;
|
||||||
|
@ -144,7 +144,7 @@ rc_deptree_load_file(const char *deptree_file)
|
|||||||
e = strsep(&p, "_");
|
e = strsep(&p, "_");
|
||||||
if (!e || strcmp(e, "depinfo") != 0)
|
if (!e || strcmp(e, "depinfo") != 0)
|
||||||
continue;
|
continue;
|
||||||
e = strsep (&p, "_");
|
e = strsep(&p, "_");
|
||||||
if (!e || sscanf(e, "%d", &i) != 1)
|
if (!e || sscanf(e, "%d", &i) != 1)
|
||||||
continue;
|
continue;
|
||||||
if (!(type = strsep(&p, "_=")))
|
if (!(type = strsep(&p, "_=")))
|
||||||
@ -425,8 +425,8 @@ visit_service(const RC_DEPTREE *deptree,
|
|||||||
continue;
|
continue;
|
||||||
provided = get_provided(di, runlevel, options);
|
provided = get_provided(di, runlevel, options);
|
||||||
TAILQ_FOREACH(p, provided, entries)
|
TAILQ_FOREACH(p, provided, entries)
|
||||||
if (strcmp (p->value, depinfo->service) == 0) {
|
if (strcmp(p->value, depinfo->service) == 0) {
|
||||||
visit_service (deptree, types, sorted, visited, di,
|
visit_service(deptree, types, sorted, visited, di,
|
||||||
runlevel, options | RC_DEP_TRACE);
|
runlevel, options | RC_DEP_TRACE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -681,7 +681,7 @@ rc_deptree_update_needed(time_t *newest, char *file)
|
|||||||
/* Create base directories if needed */
|
/* Create base directories if needed */
|
||||||
for (i = 0; depdirs[i]; i++)
|
for (i = 0; depdirs[i]; i++)
|
||||||
if (mkdir(depdirs[i], 0755) != 0 && errno != EEXIST)
|
if (mkdir(depdirs[i], 0755) != 0 && errno != EEXIST)
|
||||||
fprintf(stderr, "mkdir `%s': %s\n", depdirs[i], strerror (errno));
|
fprintf(stderr, "mkdir `%s': %s\n", depdirs[i], strerror(errno));
|
||||||
|
|
||||||
/* Quick test to see if anything we use has changed and we have
|
/* Quick test to see if anything we use has changed and we have
|
||||||
* data in our deptree */
|
* data in our deptree */
|
||||||
@ -922,7 +922,7 @@ rc_deptree_update(void)
|
|||||||
di = get_depinfo(deptree, s->value);
|
di = get_depinfo(deptree, s->value);
|
||||||
if (!di) {
|
if (!di) {
|
||||||
if (strcmp(deptype->type, "ineed") == 0) {
|
if (strcmp(deptype->type, "ineed") == 0) {
|
||||||
fprintf (stderr,
|
fprintf(stderr,
|
||||||
"Service `%s' needs non"
|
"Service `%s' needs non"
|
||||||
" existent service `%s'\n",
|
" existent service `%s'\n",
|
||||||
depinfo->service, s->value);
|
depinfo->service, s->value);
|
||||||
@ -1032,7 +1032,7 @@ rc_deptree_update(void)
|
|||||||
if (TAILQ_FIRST(config)) {
|
if (TAILQ_FIRST(config)) {
|
||||||
if ((fp = fopen(RC_DEPCONFIG, "w"))) {
|
if ((fp = fopen(RC_DEPCONFIG, "w"))) {
|
||||||
TAILQ_FOREACH(s, config, entries)
|
TAILQ_FOREACH(s, config, entries)
|
||||||
fprintf (fp, "%s\n", s->value);
|
fprintf(fp, "%s\n", s->value);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "fopen `%s': %s\n",
|
fprintf(stderr, "fopen `%s': %s\n",
|
||||||
|
@ -41,7 +41,7 @@ rc_stringlist_new(void)
|
|||||||
librc_hidden_def(rc_stringlist_new)
|
librc_hidden_def(rc_stringlist_new)
|
||||||
|
|
||||||
RC_STRING *
|
RC_STRING *
|
||||||
rc_stringlist_add (RC_STRINGLIST *list, const char *value)
|
rc_stringlist_add(RC_STRINGLIST *list, const char *value)
|
||||||
{
|
{
|
||||||
RC_STRING *s = xmalloc(sizeof(*s));
|
RC_STRING *s = xmalloc(sizeof(*s));
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ rc_stringlist_add (RC_STRINGLIST *list, const char *value)
|
|||||||
librc_hidden_def(rc_stringlist_add)
|
librc_hidden_def(rc_stringlist_add)
|
||||||
|
|
||||||
RC_STRING *
|
RC_STRING *
|
||||||
rc_stringlist_addu (RC_STRINGLIST *list, const char *value)
|
rc_stringlist_addu(RC_STRINGLIST *list, const char *value)
|
||||||
{
|
{
|
||||||
RC_STRING *s;
|
RC_STRING *s;
|
||||||
|
|
||||||
@ -74,8 +74,8 @@ rc_stringlist_delete(RC_STRINGLIST *list, const char *value)
|
|||||||
TAILQ_FOREACH(s, list, entries)
|
TAILQ_FOREACH(s, list, entries)
|
||||||
if (strcmp(s->value, value) == 0) {
|
if (strcmp(s->value, value) == 0) {
|
||||||
TAILQ_REMOVE(list, s, entries);
|
TAILQ_REMOVE(list, s, entries);
|
||||||
free (s->value);
|
free(s->value);
|
||||||
free (s);
|
free(s);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ rc_stringlist_sort(RC_STRINGLIST **list)
|
|||||||
TAILQ_REMOVE(l, s, entries);
|
TAILQ_REMOVE(l, s, entries);
|
||||||
last = NULL;
|
last = NULL;
|
||||||
TAILQ_FOREACH(n, new, entries) {
|
TAILQ_FOREACH(n, new, entries) {
|
||||||
if (strcmp (s->value, n->value) < 0)
|
if (strcmp(s->value, n->value) < 0)
|
||||||
break;
|
break;
|
||||||
last = n;
|
last = n;
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ rc_service_state(const char *service)
|
|||||||
|
|
||||||
if (state & RC_SERVICE_STOPPED) {
|
if (state & RC_SERVICE_STOPPED) {
|
||||||
dirs = ls_dir(RC_SVCDIR "/scheduled", 0);
|
dirs = ls_dir(RC_SVCDIR "/scheduled", 0);
|
||||||
TAILQ_FOREACH (dir, dirs, entries) {
|
TAILQ_FOREACH(dir, dirs, entries) {
|
||||||
snprintf(file, sizeof(file),
|
snprintf(file, sizeof(file),
|
||||||
RC_SVCDIR "/scheduled/%s/%s",
|
RC_SVCDIR "/scheduled/%s/%s",
|
||||||
dir->value, service);
|
dir->value, service);
|
||||||
@ -892,7 +892,7 @@ rc_services_in_runlevel_stacked(const char *runlevel)
|
|||||||
|
|
||||||
list = rc_services_in_runlevel(runlevel);
|
list = rc_services_in_runlevel(runlevel);
|
||||||
stacks = rc_runlevel_stacks(runlevel);
|
stacks = rc_runlevel_stacks(runlevel);
|
||||||
TAILQ_FOREACH (stack, stacks, entries) {
|
TAILQ_FOREACH(stack, stacks, entries) {
|
||||||
sl = rc_services_in_runlevel(stack->value);
|
sl = rc_services_in_runlevel(stack->value);
|
||||||
if (list != NULL) {
|
if (list != NULL) {
|
||||||
TAILQ_CONCAT(list, sl, entries);
|
TAILQ_CONCAT(list, sl, entries);
|
||||||
@ -1008,7 +1008,7 @@ rc_services_scheduled_by(const char *service)
|
|||||||
RC_STRING *dir;
|
RC_STRING *dir;
|
||||||
char file[PATH_MAX];
|
char file[PATH_MAX];
|
||||||
|
|
||||||
TAILQ_FOREACH (dir, dirs, entries) {
|
TAILQ_FOREACH(dir, dirs, entries) {
|
||||||
snprintf(file, sizeof(file), RC_SVCDIR "/scheduled/%s/%s",
|
snprintf(file, sizeof(file), RC_SVCDIR "/scheduled/%s/%s",
|
||||||
dir->value, service);
|
dir->value, service);
|
||||||
if (exists(file))
|
if (exists(file))
|
||||||
|
Loading…
Reference in New Issue
Block a user