/lxc/src/lxc/ |
H A D | error.c | 44 int ret = 0; local 47 ret = WEXITSTATUS(status); 48 if (ret) 49 INFO("Child <%d> ended on error (%d).", pid, ret); 57 return ret;
|
H A D | commands.c | 84 int ret; local 91 ret = snprintf(path, len, "lxc/%s/command", hashed_sock_name); 92 if (ret < 0 || ret >= len) { 107 ret = snprintf(path, len, "%s/%s/command", lxcpath, name); 108 if (ret < 0) { 112 if (ret < len) 115 /* ret >= len; lxcpath or name is too long. hash both */ 118 ret = snprintf(tmppath, tmplen, "%s/%s", lxcpath, name); 119 if (ret < 171 int ret,rspfd; local 240 int ret; local 282 int sock, ret = -1; local 350 int stopped, ret; local 390 int ret, stopped; local 420 int ret, stopped; local 455 int ret, stopped; local 514 int ret, stopped; local 568 int ret, stopped; local 609 int ret, stopped; local 671 int ret, stopped; local 705 int ret, stopped; local 779 int ret, stopped; local 817 int ret, stopped; local 882 int ret; local 947 int opt = 1, ret = -1, connection; local 1020 int ret, fd = handler->conf->maincmd_fd; local [all...] |
H A D | lxclock.c | 78 int ret; local 80 if ((ret = pthread_mutex_lock(l)) != 0) { 81 fprintf(stderr, "pthread_mutex_lock returned:%d %s\n", ret, strerror(ret)); 89 int ret; local 91 if ((ret = pthread_mutex_unlock(l)) != 0) { 92 fprintf(stderr, "pthread_mutex_unlock returned:%d %s\n", ret, strerror(ret)); 100 int ret; local 123 ret 148 int ret; local 194 int ret = -1, saved_errno = errno; local 252 int ret = 0, saved_errno = errno; local 354 int ret; local [all...] |
H A D | monitor.c | 58 int ret; local 66 ret = snprintf(fifo_path, fifo_path_sz, "%s/lxc/%s", rundir, lxcpath); 67 if (ret < 0 || (size_t)ret >= fifo_path_sz) { 72 ret = mkdir_p(fifo_path, 0755); 73 if (ret < 0) { 76 return ret; 79 ret = snprintf(fifo_path, fifo_path_sz, "%s/lxc/%s/monitor-fifo", rundir, lxcpath); 80 if (ret < 0 || (size_t)ret > 91 int fd,ret; local 167 int ret; local 212 int ret = -1; local 259 int ret; local 310 int ret; local [all...] |
H A D | genl.c | 42 int len, ret; local 61 ret = netlink_open(&handler, NETLINK_GENERIC); 62 if (ret) 65 ret = nla_put_string((struct nlmsg *)&request->nlmsghdr, 67 if (ret) 70 ret = netlink_transaction(&handler, (struct nlmsg *)&request->nlmsghdr, 72 if (ret < 0) 78 ret = -ENOMSG; 85 ret = -EMSGSIZE; 93 ret 108 int ret; local [all...] |
H A D | lxc_monitord.c | 83 int ret; local 85 ret = lxc_monitor_fifo_name(mon->lxcpath, fifo_path, sizeof(fifo_path), 1); 86 if (ret < 0) 87 return ret; 89 ret = mknod(fifo_path, S_IFIFO|S_IRUSR|S_IWUSR, 0); 90 if (ret < 0 && errno != EEXIST) { 118 int ret; local 120 ret = lxc_monitor_fifo_name(mon->lxcpath, fifo_path, sizeof(fifo_path), 0); 121 if (ret < 0) 122 return ret; 172 int ret,clientfd; local 262 int ret; local 294 int ret,i; local 316 int ret; local 347 int ret, pipefd; local [all...] |
H A D | sync.c | 39 ssize_t ret; local 41 ret = read(fd, &sync, sizeof(sync)); 42 if (ret < 0) { 47 if (!ret) 50 if ((size_t)ret != sizeof(sync)) { 51 ERROR("unexpected sync size: %zu expected %zu", (size_t)ret, sizeof(sync)); 119 int ret; local 121 ret = socketpair(AF_LOCAL, SOCK_STREAM, 0, handler->sv); 122 if (ret) {
|
H A D | caps.c | 48 int ret; local 61 ret = cap_clear_flag(caps, CAP_EFFECTIVE); 62 if (ret) { 67 ret = cap_set_proc(caps); 68 if (ret) { 82 int ret; local 99 ret = cap_get_flag(caps, cap, CAP_PERMITTED, &flag); 100 if (ret) { 110 ret = cap_set_flag(caps, CAP_EFFECTIVE, 1, &cap, flag); 111 if (ret) { 214 int ret; local [all...] |
/lxc/src/tests/ |
H A D | attach.c | 87 int ret; local 95 ret = pipe(pipefd); 96 if (ret < 0) { 97 TSTERR("pipe failed %d", ret); 98 return ret; 103 ret = ct->attach(ct, test_attach_lsm_func_func, NULL, &attach_options, &pid); 104 if (ret < 0) { 109 ret = read(pipefd[0], result, sizeof(result)-1); 110 if (ret < 0) { 111 TSTERR("read failed %d", ret); 133 int ret; local 198 int ret; local 249 int ret; local 306 int ret; local 351 int ret = -1; local 394 int ret; local [all...] |
H A D | get_item.c | 35 int ret = EXIT_FAILURE; local 48 ret = c->get_config_item(c, "lxc.hook.pre-start", v2, 255); 49 if (ret < 0) { 50 fprintf(stderr, "%d: get_config_item(lxc.hook.pre-start) returned %d\n", __LINE__, ret); 53 fprintf(stderr, "lxc.hook.pre-start returned %d %s\n", ret, v2); 55 ret = c->get_config_item(c, "lxc.network", v2, 255); 56 if (ret < 0) { 57 fprintf(stderr, "%d: get_config_item returned %d\n", __LINE__, ret); 60 fprintf(stderr, "%d: get_config_item(lxc.network) returned %d %s\n", __LINE__, ret, v2); 65 ret [all...] |
H A D | getkeys.c | 35 int len, ret; local 40 ret = 1; 49 ret = 1; 52 ret = c->get_keys(c, NULL, v3, len+1); 53 if (ret != len) { 54 fprintf(stderr, "%d: failed to get keys (%d)\n", __LINE__, ret); 55 ret = 1; 58 printf("get_keys returned %d\n%s", ret, v3); 60 ret = c->get_keys(c, "lxc.network.0", v3, 2000); 61 if (ret < [all...] |
H A D | destroytest.c | 33 int status, ret; local 41 ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); 47 ret = waitpid(pid, &status, 0); 48 if (ret == -1) { 54 if (ret != pid) 66 int ret = 1; local 70 ret = 1; 100 ret = 0; 103 exit(ret);
|
H A D | console.c | 58 int nrconsoles, i, ret = -1; local 67 ret = c->console_getfd(c, &ttynum[0], &masterfd[0]); 68 if (ret < 0) { 72 ttyfd[0] = ret; 79 ret = c->console_getfd(c, &ttynum[0], &masterfd[1]); 80 if (ret != -1) { 92 ret = c->console_getfd(c, &ttynum[nrconsoles], &masterfd[nrconsoles]); 93 if (ret < 0) 95 ttyfd[nrconsoles] = ret; 103 ret 122 int ret; local 169 int ret; local [all...] |
H A D | startone.c | 35 int status, ret; local 43 ret = execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); 49 ret = waitpid(pid, &status, 0); 50 if (ret == -1) { 56 if (ret != pid) 67 int status, ret; local 75 ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); 81 ret = waitpid(pid, &status, 0); 82 if (ret == -1) { 88 if (ret ! 100 int ret = 0; local [all...] |
H A D | cgpath.c | 51 int ret = -1; local 79 ret = lxc_cgroup_get("memory.soft_limit_in_bytes", value, sizeof(value), 81 if (ret < 0) { 87 ret = lxc_cgroup_set("memory.soft_limit_in_bytes", "512M", c->name, c->config_path); 88 if (ret < 0) { 89 TSTERR("lxc_cgroup_set failed %d %d", ret, errno); 92 ret = lxc_cgroup_get("memory.soft_limit_in_bytes", value, sizeof(value), 94 if (ret < 0) { 104 ret = lxc_cgroup_set("memory.soft_limit_in_bytes", value_save, 106 if (ret < 125 int ret; local 171 int ret = EXIT_FAILURE; local [all...] |
H A D | locktests.c | 35 int ret, status; local 74 ret = waitpid(pid, &status, WNOHANG); 75 if (ret == pid) { // task exited 84 } else if (ret < 0) { 98 int ret; local 106 ret = lxclock(lock, 0); 107 if (ret) { 108 fprintf(stderr, "%d: failed to take unnamed lock (%d)\n", __LINE__, ret); 112 ret = lxcunlock(lock); 113 if (ret) { [all...] |
H A D | saveconfig.c | 33 int status, ret; local 41 ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); 47 ret = waitpid(pid, &status, 0); 48 if (ret == -1) { 54 if (ret != pid) 66 int ret = 1; local 70 ret = 1; 112 ret = 0; 115 exit(ret);
|
H A D | aa.c | 66 int ret; local 72 ret = pipe(pipefd); 73 if (ret < 0) { 74 fprintf(stderr, "pipe failed %d\n", ret); 80 ret = c->attach(c, test_attach_write_file, fnam, &attach_options, &pid); 81 if (ret < 0) { 86 ret = read(pipefd[0], result, sizeof(result)-1); 87 if (ret < 0) { 88 fprintf(stderr, "read failed %d\n", ret); 117 int i, ret; local [all...] |
H A D | reboot.c | 50 pid_t ret; local 52 ret = clone(do_reboot, stack, CLONE_NEWPID | SIGCHLD, &cmd); 53 if (ret < 0) { 80 int ret; local 86 ret = fscanf(f, "%d", &v); 88 if (ret != 1) 90 ret = reboot(v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF); 91 if (ret != -1)
|
/lxc/src/lxc/bdev/ |
H A D | lxcloop.c | 52 int len, ret; local 65 ret = snprintf(srcdev, len, "%s/%s/rootdev", lxcpath, cname); 66 if (ret < 0 || ret >= len) 72 ret = snprintf(new->src, len + 5, "loop:%s", srcdev); 73 if (ret < 0 || ret >= len + 5) 79 ret = snprintf(new->dest, len, "%s/%s/rootfs", lxcpath, cname); 80 if (ret < 0 || ret > 110 int ret, len; local 167 int ret, loopfd; local 192 int ret; local 208 int fd, ret; local [all...] |
H A D | lxclvm.c | 67 int ret, pid, len; local 78 ret = snprintf(sz, 24, "%"PRIu64"b", size); 79 if (ret < 0 || ret >= 24) 102 ret = snprintf(tp, len, "%s/%s", pathdup, thinpool); 103 if (ret < 0 || ret >= len) 106 ret = lvm_is_thin_pool(tp); 107 INFO("got %d for thin pool at path: %s", ret, tp); 108 if (ret < 134 int ret; local 185 int ret, len, status, start=0; local 233 int ret, pid; local 284 int len, ret; local 380 int ret, len; local [all...] |
H A D | lxcaufs.c | 66 int ret, len, lastslashidx; local 83 if ((ret = mkdir(delta, 0755)) < 0) { 98 ret = snprintf(new->src, len, "aufs:%s:%s", orig->src, delta); 100 if (ret < 0 || ret >= len) 108 int len, ret; local 123 if ((ret = mkdir(ndelta, 0755)) < 0 && errno != EEXIST) { 136 ret = userns_exec_1(conf, rsync_delta_wrapper, &rdata); 138 ret = rsync_delta(&rdata); 139 if (ret) { 178 int ret, len = strlen(dest), newlen; local 242 int ret; local 363 int ret = 0; local [all...] |
H A D | lxcoverlay.c | 81 int ret, len, lastslashidx; local 102 if ((ret = mkdir(delta, 0755)) < 0) { 143 ret = snprintf(new->src, len, "overlayfs:%s:%s", orig->src, delta); 145 if (ret < 0 || ret >= len) 155 int len, ret, lastslashidx; local 170 if ((ret = mkdir(ndelta, 0755)) < 0 && errno != EEXIST) { 218 ret = snprintf(new->src, len, "overlayfs:%s:%s", nsrc, ndelta); 221 if (ret < 0 || ret > 248 int ret, len = strlen(dest), newlen; local 322 int ret, ret2; local 495 int ret = 0; local 583 int ret = 0; local 668 int ret; local 680 int ret; local 747 int ret = -1; local [all...] |
/lxc/src/lxc/tools/ |
H A D | lxc_stop.c | 102 int ret; local 128 ret = gettimeofday(&tv, NULL); 129 if (ret) 136 ret = gettimeofday(&tv, NULL); 137 if (ret) 159 int ret = EXIT_FAILURE; local 162 exit(ret); 166 exit(ret); 183 exit(ret); 188 exit(ret); [all...] |
/lxc/src/lxc/lsm/ |
H A D | apparmor.c | 57 int ret; local 59 ret = stat(AA_MOUNT_RESTR, &statbuf); 60 if (ret == 0) 69 int ret; local 74 ret = fscanf(fin, "%c", &e); 76 if (ret == 1 && e == 'Y') { 87 int ret; local 92 ret = snprintf(path, 100, "/proc/%d/attr/current", pid); 93 if (ret < 0 || ret > 139 bool ret = false; local [all...] |