X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafm-launch.c;h=d80e43b471f8cadded381bce59dbf31382d2fcbd;hb=d87f24e7f21e581e6b90034ca0df0459a271244a;hp=cdfdc41f91e056d0b4983397ac409518042b8e88;hpb=cd4ba256dd488e6dc4ebffdaa6dfcfe107c35908;p=src%2Fapp-framework-main.git diff --git a/src/afm-launch.c b/src/afm-launch.c index cdfdc41..d80e43b 100644 --- a/src/afm-launch.c +++ b/src/afm-launch.c @@ -1,5 +1,5 @@ /* - Copyright 2015, 2016 IoT.bzh + Copyright 2015, 2016, 2017 IoT.bzh author: José Bollo @@ -109,6 +109,7 @@ static const char readystr[] = "READY=1"; */ static const int ready_timeout = 1500; +#if defined(DUMP_LAUNCHERS) /* * dump all the known launchers to the 'file' */ @@ -132,6 +133,7 @@ static void dump_launchers(FILE *file) fprintf(file, "\n"); } } +#endif /* * update 'cread' to point the the next token @@ -729,6 +731,9 @@ static pid_t launch( close(rpipe[0]); + /* set name by appid */ + verbose_set_name(desc->appid, 0); + /* avoid set-gid effect */ setresgid(groupid, groupid, groupid); @@ -766,6 +771,7 @@ static pid_t launch( /* executes the process */ rc = execve(args[0], args, env); + access(args[0], X_OK); ERROR("failed to exec master %s: %m", args[0]); _exit(1); return -1; @@ -854,7 +860,7 @@ static struct desc_launcher *search_launcher(const char *type, for (dl = launchers ; dl ; dl = dl->next) if (dl->mode == mode) for (tl = dl->types ; tl != NULL ; tl = tl->next) - if (!strcmp(tl->type, type)) + if (!strcasecmp(tl->type, type)) return dl; return NULL; } @@ -942,7 +948,10 @@ int afm_launch_initialize() /* reads the configuration file */ rc = read_configuration_file(FWK_LAUNCH_CONF); - /* dump_launchers(stderr); */ +#if defined(DUMP_LAUNCHERS) + if (!rc) + dump_launchers(stderr); +#endif return rc; }