Lines Matching refs:ret
41 int ret; in change_mountns() local
43 ret = unshare(CLONE_NEWNS); in change_mountns()
44 ASSERT_EQ(ret, 0) { in change_mountns()
49 ret = mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0); in change_mountns()
50 ASSERT_EQ(ret, 0) { in change_mountns()
58 int fd, ret, saved_errno, result = 1; in __do_binderfs_test() local
74 ret = mount(NULL, binderfs_mntpt, "binder", 0, 0); in __do_binderfs_test()
75 EXPECT_EQ(ret, 0) { in __do_binderfs_test()
94 ret = ioctl(fd, BINDER_CTL_ADD, &device); in __do_binderfs_test()
98 EXPECT_GE(ret, 0) { in __do_binderfs_test()
117 ret = ioctl(fd, BINDER_VERSION, &version); in __do_binderfs_test()
121 EXPECT_GE(ret, 0) { in __do_binderfs_test()
131 ret = unlink(device_path); in __do_binderfs_test()
132 EXPECT_EQ(ret, 0) { in __do_binderfs_test()
141 ret = unlink(device_path); in __do_binderfs_test()
142 EXPECT_NE(ret, 0) { in __do_binderfs_test()
156 ret = umount2(binderfs_mntpt, MNT_DETACH); in __do_binderfs_test()
157 EXPECT_EQ(ret, 0) { in __do_binderfs_test()
161 ret = rmdir(binderfs_mntpt); in __do_binderfs_test()
162 EXPECT_EQ(ret, 0) { in __do_binderfs_test()
171 int status, ret; in wait_for_pid() local
174 ret = waitpid(pid, &status, 0); in wait_for_pid()
175 if (ret == -1) { in wait_for_pid()
208 ssize_t ret; in read_nointr() local
210 ret = read(fd, buf, count); in read_nointr()
211 if (ret < 0 && errno == EINTR) in read_nointr()
214 return ret; in read_nointr()
219 ssize_t ret; in write_nointr() local
221 ret = write(fd, buf, count); in write_nointr()
222 if (ret < 0 && errno == EINTR) in write_nointr()
225 return ret; in write_nointr()
232 int ret; in write_id_mapping() local
244 ret = write_nointr(setgroups_fd, "deny", sizeof("deny") - 1); in write_id_mapping()
246 if (ret != sizeof("deny") - 1) in write_id_mapping()
253 ret = snprintf(path, sizeof(path), "/proc/%d/uid_map", pid); in write_id_mapping()
256 ret = snprintf(path, sizeof(path), "/proc/%d/gid_map", pid); in write_id_mapping()
261 if (ret < 0 || ret >= sizeof(path)) in write_id_mapping()
268 ret = write_nointr(fd, buf, buf_size); in write_id_mapping()
270 if (ret != buf_size) in write_id_mapping()
278 int ret; in change_userns() local
283 ret = unshare(CLONE_NEWUSER); in change_userns()
284 ASSERT_EQ(ret, 0) { in change_userns()
289 ret = write_nointr(syncfds[0], "1", 1); in change_userns()
290 ASSERT_EQ(ret, 1) { in change_userns()
294 ret = read_nointr(syncfds[0], &buf, 1); in change_userns()
295 ASSERT_EQ(ret, 1) { in change_userns()
308 int ret; in change_idmaps() local
314 ret = read_nointr(syncfds[1], &buf, 1); in change_idmaps()
315 ASSERT_EQ(ret, 1) { in change_idmaps()
320 ret = write_id_mapping(UID_MAP, pid, id_map, strlen(id_map)); in change_idmaps()
321 ASSERT_EQ(ret, 0) { in change_idmaps()
326 ret = write_id_mapping(GID_MAP, pid, id_map, strlen(id_map)); in change_idmaps()
327 ASSERT_EQ(ret, 0) { in change_idmaps()
331 ret = write_nointr(syncfds[1], "1", 1); in change_idmaps()
332 ASSERT_EQ(ret, 1) { in change_idmaps()
345 int ret; in binder_version_thread() local
347 ret = ioctl(fd, BINDER_VERSION, &version); in binder_version_thread()
348 if (ret < 0) in binder_version_thread()
366 int fd, ret; in TEST() local
372 ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, syncfds); in TEST()
373 ASSERT_EQ(ret, 0) { in TEST()
396 ret = mount(NULL, binderfs_mntpt, "binder", 0, 0); in TEST()
397 ASSERT_EQ(ret, 0) { in TEST()
413 ret = ioctl(fd, BINDER_CTL_ADD, &device); in TEST()
415 ASSERT_EQ(ret, 0) { in TEST()
428 ret = umount2(binderfs_mntpt, MNT_DETACH); in TEST()
429 ASSERT_EQ(ret, 0) { in TEST()
442 ret = pthread_create(&threads[i], &attr, binder_version_thread, INT_TO_PTR(fds[k])); in TEST()
443 if (ret) { in TEST()
453 ret = pthread_join(threads[j], &fdptr); in TEST()
454 if (ret) in TEST()
469 ret = wait_for_pid(pid); in TEST()
470 ASSERT_EQ(ret, 0) { in TEST()
486 int ret; in TEST() local
490 ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, syncfds); in TEST()
491 ASSERT_EQ(ret, 0) { in TEST()
511 ret = wait_for_pid(pid); in TEST()
512 if (ret) { in TEST()
513 if (ret == 2) in TEST()
515 ASSERT_EQ(ret, 0) { in TEST()