Skip to content

Commit

Permalink
indent
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikwidlund committed Jan 4, 2021
1 parent d6d566c commit 091e4bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/dynamic/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <sys/types.h>
#include <sys/epoll.h>


#include "list.h"
#include "buffer.h"
#include "vector.h"
Expand Down Expand Up @@ -137,7 +136,7 @@ static void pool_update(pool *pool)

while (pool->workers_count > workers_goal)
{
e = pool_send(pool, (pool_message[]){{.type = POOL_MESSAGE_WORKER}});
e = pool_send(pool, (pool_message[]) {{.type = POOL_MESSAGE_WORKER}});
if (e == -1)
break;
pool->workers_count--;
Expand All @@ -146,7 +145,7 @@ static void pool_update(pool *pool)
while (!list_empty(&pool->jobs_queued))
{
user = list_front(&pool->jobs_queued);
e = pool_send(pool, (pool_message[]){{.type = POOL_MESSAGE_JOB, .user = user}});
e = pool_send(pool, (pool_message[]) {{.type = POOL_MESSAGE_JOB, .user = user}});
if (e == -1)
break;
list_splice(list_front(&pool->jobs_waiting), user);
Expand Down Expand Up @@ -252,7 +251,7 @@ core_id pool_enqueue(pool *pool, core_callback *callback, void *state)
pool_activated = 1;
job = list_push_back(&pool->jobs_queued, NULL, sizeof *job);
*job = (core_handler) {.callback = callback, .state = state};
pool->jobs_count ++;
pool->jobs_count++;

pool_update(pool);

Expand Down
9 changes: 4 additions & 5 deletions test/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,15 @@ void fails(__attribute__((unused)) void **unused)
debug_socketpair = 0;
assert_int_equal(pool_errors(&p), 1);
core_destruct(NULL);

}

int main()
{
const struct CMUnitTest tests[] =
{
cmocka_unit_test(basic),
cmocka_unit_test(fails),
};
{
cmocka_unit_test(basic),
cmocka_unit_test(fails),
};

return cmocka_run_group_tests(tests, NULL, NULL);
}

0 comments on commit 091e4bd

Please sign in to comment.