lxclock: cleanup lxc_putlock()

parent 42356060
......@@ -264,24 +264,16 @@ void lxc_putlock(struct lxc_lock *l)
if (!l)
return;
switch(l->type) {
switch (l->type) {
case LXC_LOCK_ANON_SEM:
if (l->u.sem) {
sem_destroy(l->u.sem);
free(l->u.sem);
l->u.sem = NULL;
free_disarm(l->u.sem);
}
break;
case LXC_LOCK_FLOCK:
if (l->u.f.fd >= 0) {
close(l->u.f.fd);
l->u.f.fd = -1;
}
free(l->u.f.fname);
l->u.f.fname = NULL;
close_prot_errno_disarm(l->u.f.fd);
free_disarm(l->u.f.fname);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment