X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fjobs.c;h=3d912a54c1307f5c8d7d253a3b151a558a730be1;hb=c9ba2ce49808a19a4ef982280a46256797b830ae;hp=5d2a29b4ba62e5c0c0f0019821ab08d543ff5a8c;hpb=c710a0da4ebcc126275c42a0387ff85b2557e3ae;p=src%2Fapp-framework-binder.git diff --git a/src/jobs.c b/src/jobs.c index 5d2a29b4..3d912a54 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -847,7 +847,10 @@ int jobs_add_me() return 0; } - +/** + * Gets a sd_event item for the current thread. + * @return a sd_event or NULL in case of error + */ struct sd_event *jobs_get_sd_event() { struct events *events; @@ -885,9 +888,10 @@ struct sd_event *jobs_get_sd_event() events = NULL; } } else { - if (!events) + if (!events) { ERROR("out of memory"); - else { + errno = ENOMEM; + } else { free(events); ERROR("creation of sd_event failed: %m"); events = NULL; @@ -912,7 +916,7 @@ struct sd_event *jobs_get_sd_event() } /** - * run the jobs as + * Enter the jobs processing loop. * @param allowed_count Maximum count of thread for jobs including this one * @param start_count Count of thread to start now, must be lower. * @param waiter_count Maximum count of jobs that can be waiting. @@ -941,4 +945,5 @@ int jobs_enter(int allowed_count, int start_count, int waiter_count, void (*star /* turn as processing thread */ return jobs_add_me(); -}; +} +