From 0181715d9d2bb8b93bb1969c32256ea0051e3ac9 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Thu, 21 Jul 2011 22:23:04 +0200 Subject: [PATCH] Refactored some sizeof() --- src/ct_server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ct_server.c b/src/ct_server.c index cca1b915..bbb6e668 100644 --- a/src/ct_server.c +++ b/src/ct_server.c @@ -607,8 +607,8 @@ static void thread_spawn_or_panic(unsigned int cpus, int efd, int refd, if (ret < 0) syslog_panic("Cannot create event socket!\n"); - threadpool[i].z = xmalloc(sizeof(struct z_struct)); - threadpool[i].c = xmalloc(sizeof(struct curve25519_struct)); + threadpool[i].z = xmalloc(sizeof(*threadpool[i].z)); + threadpool[i].c = xmalloc(sizeof(*threadpool[i].c)); threadpool[i].parent.efd = efd; threadpool[i].parent.refd = refd; threadpool[i].parent.tunfd = tunfd; @@ -622,7 +622,7 @@ static void thread_spawn_or_panic(unsigned int cpus, int efd, int refd, syslog_panic("Thread creation failed!\n"); ret = pthread_setaffinity_np(threadpool[i].trid, - sizeof(cpu_set_t), &cpuset); + sizeof(cpuset), &cpuset); if (ret < 0) syslog_panic("Thread CPU migration failed!\n"); -- 2.11.4.GIT