From b4441d1bd8a56ed9ec08603e1d4acf5c779fe935 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 11 Oct 2016 18:46:54 -0700 Subject: [PATCH] restorer.c: rm unneded struct init This 'struct timespec' initialization is non needed as we call clock_gettime() right away which is supposed to fill it in. The real reason of removing this init is when compiled by clang with -O0 etc (i.e. compiler flags set when GCOV=1 env var is present), clang inserts a call to memset to initialize the structure. This, of course, leads to "compel piegen" complaining: Unexpected undefined symbol: `memset'. External symbol in PIE? One way of solving it would be to provide a memset() which will call builtin_memset(), or a simple C implemenation. But as this is the only place that triggers such a call to memset(), and this initialization is not really needed, it's easier just to remove it. Now, there might be more cases like this in the future, but for now we are good. Signed-off-by: Kir Kolyshkin Signed-off-by: Pavel Emelyanov --- criu/pie/restorer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c index 677fc2646..a8ceb99b1 100644 --- a/criu/pie/restorer.c +++ b/criu/pie/restorer.c @@ -803,7 +803,7 @@ static int timerfd_arm(struct task_restore_args *args) pr_debug("timerfd: arm for fd %d (%d)\n", t->fd, i); if (t->settime_flags & TFD_TIMER_ABSTIME) { - struct timespec ts = { }; + struct timespec ts; /* * We might need to adjust value because the checkpoint