#include <sys/un.h>
#include "log.h"
-#include "lxclock.h"
lxc_log_define(lxc_af_unix, lxc);
int fd;
struct sockaddr_un addr;
- process_lock();
fd = socket(PF_UNIX, SOCK_STREAM, 0);
- process_unlock();
if (fd < 0)
return -1;
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr))) {
int tmp = errno;
- process_lock();
close(fd);
- process_unlock();
errno = tmp;
return -1;
}
#include "mainloop.h"
#include "af_unix.h"
#include "config.h"
-#include "lxclock.h"
/*
* This file provides the different functions for clients to
ret = lxc_cmd_rsp_recv(sock, cmd);
out:
- if (!stay_connected || ret <= 0) {
- process_lock();
+ if (!stay_connected || ret <= 0)
close(sock);
- process_unlock();
- }
if (stay_connected && ret > 0)
cmd->rsp.ret = sock;
free(s);
return false;
}
- process_lock();
ret = mkdir(s, 0755);
- process_unlock();
if (ret) {
if (errno == EEXIST)
ret = 0;
if (lret)
return false;
- process_lock();
fout = fopen(alt_file, "w");
- process_unlock();
if (!fout)
goto out;
write_config(fout, c->lxc_conf);
- process_lock();
fclose(fout);
- process_unlock();
ret = true;
out:
#include "parse.h"
#include "config.h"
#include "utils.h"
-#include "lxclock.h"
#include <lxc/log.h>
/* Workaround for the broken signature of alphasort() in bionic.
char *line = NULL;
size_t len = 0;
- process_lock();
f = fopen(file, "r");
- process_unlock();
if (!f) {
SYSERROR("failed to open %s", file);
return -1;
if (line)
free(line);
- process_lock();
fclose(f);
- process_unlock();
return err;
}
#include "utils.h"
#include "log.h"
-#include "lxclock.h"
lxc_log_define(lxc_utils, lxc);
if (!fnam)
return -1;
- process_lock();
- f = fopen_cloexec(fnam, "r");
- process_unlock();
- if (f < 0) {
+ if ((f = fopen_cloexec(fnam, "r")) < 0) {
SYSERROR("Error opening template");
return -1;
}
fclose(f);
return -1;
}
- process_lock();
- ret = fclose(f);
- process_unlock();
- if (ret < 0) {
+ if (fclose(f) < 0) {
SYSERROR("Failre closing template");
free(buf);
return -1;