Lines Matching refs:r

161   int r = uv_exepath(exepath, &exepath_size);  in init_process_options()  local
162 ASSERT_OK(r); in init_process_options()
188 int r; in TEST_IMPL() local
193 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
194 ASSERT(r == UV_ENOENT || r == UV_EACCES); in TEST_IMPL()
206 int r; in TEST_IMPL() local
213 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
214 ASSERT(r == UV_ENOENT || r == UV_EACCES); in TEST_IMPL()
265 int r; in TEST_IMPL() local
269 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
270 ASSERT_OK(r); in TEST_IMPL()
272 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
273 ASSERT_OK(r); in TEST_IMPL()
284 int r; in TEST_IMPL() local
297 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
298 ASSERT_OK(r); in TEST_IMPL()
300 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
301 ASSERT_OK(r); in TEST_IMPL()
303 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
304 ASSERT_OK(r); in TEST_IMPL()
317 int r; in TEST_IMPL() local
328 r = uv_fs_open(NULL, &fs_req, "stdout_file", UV_FS_O_CREAT | UV_FS_O_RDWR, in TEST_IMPL()
330 ASSERT_NE(r, -1); in TEST_IMPL()
333 file = r; in TEST_IMPL()
341 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
342 ASSERT_OK(r); in TEST_IMPL()
344 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
345 ASSERT_OK(r); in TEST_IMPL()
351 r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); in TEST_IMPL()
352 ASSERT_EQ(12, r); in TEST_IMPL()
355 r = uv_fs_close(NULL, &fs_req, file, NULL); in TEST_IMPL()
356 ASSERT_OK(r); in TEST_IMPL()
371 int r; in TEST_IMPL() local
382 r = uv_fs_open(NULL, &fs_req, "stdout_file", UV_FS_O_CREAT | UV_FS_O_RDWR, in TEST_IMPL()
384 ASSERT_NE(r, -1); in TEST_IMPL()
387 file = r; in TEST_IMPL()
397 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
398 ASSERT_OK(r); in TEST_IMPL()
400 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
401 ASSERT_OK(r); in TEST_IMPL()
407 r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); in TEST_IMPL()
408 ASSERT_EQ(27, r); in TEST_IMPL()
411 r = uv_fs_close(NULL, &fs_req, file, NULL); in TEST_IMPL()
412 ASSERT_OK(r); in TEST_IMPL()
428 int r; in TEST_IMPL() local
440 r = uv_fs_open(NULL, in TEST_IMPL()
446 ASSERT_NE(r, -1); in TEST_IMPL()
448 file = dup2(r, STDERR_FILENO); in TEST_IMPL()
459 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
460 ASSERT_OK(r); in TEST_IMPL()
462 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
463 ASSERT_OK(r); in TEST_IMPL()
469 r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); in TEST_IMPL()
470 ASSERT_EQ(27, r); in TEST_IMPL()
473 r = uv_fs_close(NULL, &fs_req, file, NULL); in TEST_IMPL()
474 ASSERT_OK(r); in TEST_IMPL()
493 int r; in TEST_IMPL() local
507 r = uv_fs_open(NULL, in TEST_IMPL()
513 ASSERT_NE(r, -1); in TEST_IMPL()
515 stdout_file = dup2(r, STDOUT_FILENO); in TEST_IMPL()
519 r = uv_fs_open(NULL, &fs_req, "stderr_file", O_CREAT | O_RDWR, in TEST_IMPL()
521 ASSERT_NE(r, -1); in TEST_IMPL()
523 stderr_file = dup2(r, STDERR_FILENO); in TEST_IMPL()
536 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
537 ASSERT_OK(r); in TEST_IMPL()
539 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
540 ASSERT_OK(r); in TEST_IMPL()
548 r = uv_fs_read(NULL, &fs_req, stdout_file, &buf, 1, 0, NULL); in TEST_IMPL()
549 ASSERT_GE(r, 15); in TEST_IMPL()
552 r = uv_fs_close(NULL, &fs_req, stdout_file, NULL); in TEST_IMPL()
553 ASSERT_OK(r); in TEST_IMPL()
560 r = uv_fs_read(NULL, &fs_req, stderr_file, &buf, 1, 0, NULL); in TEST_IMPL()
561 ASSERT_GE(r, 12); in TEST_IMPL()
564 r = uv_fs_close(NULL, &fs_req, stderr_file, NULL); in TEST_IMPL()
565 ASSERT_OK(r); in TEST_IMPL()
584 int r; in TEST_IMPL() local
603 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
604 ASSERT_OK(r); in TEST_IMPL()
608 r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); in TEST_IMPL()
609 ASSERT_OK(r); in TEST_IMPL()
611 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
612 ASSERT_OK(r); in TEST_IMPL()
614 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
615 ASSERT_OK(r); in TEST_IMPL()
627 int r; in TEST_IMPL() local
642 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
643 ASSERT_OK(r); in TEST_IMPL()
645 r = uv_read_start((uv_stream_t*) &pipe, on_alloc, on_read); in TEST_IMPL()
646 ASSERT_OK(r); in TEST_IMPL()
648 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
649 ASSERT_OK(r); in TEST_IMPL()
664 int r; in spawn_tcp_server_helper() local
666 r = uv_tcp_init(uv_default_loop(), &tcp); in spawn_tcp_server_helper()
667 ASSERT_OK(r); in spawn_tcp_server_helper()
674 r = uv_tcp_open(&tcp, handle); in spawn_tcp_server_helper()
675 ASSERT_OK(r); in spawn_tcp_server_helper()
680 r = uv_listen((uv_stream_t*) &tcp, SOMAXCONN, NULL); in spawn_tcp_server_helper()
681 ASSERT_OK(r); in spawn_tcp_server_helper()
691 int r; in TEST_IMPL() local
701 r = uv_tcp_init_ex(uv_default_loop(), &tcp_server, AF_INET); in TEST_IMPL()
702 ASSERT_OK(r); in TEST_IMPL()
703 r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); in TEST_IMPL()
704 ASSERT_OK(r); in TEST_IMPL()
706 r = uv_fileno((uv_handle_t*) &tcp_server, &handle); in TEST_IMPL()
709 r = uv_fileno((uv_handle_t*) &tcp_server, &fd); in TEST_IMPL()
711 ASSERT_OK(r); in TEST_IMPL()
725 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
726 ASSERT_OK(r); in TEST_IMPL()
728 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
729 ASSERT_OK(r); in TEST_IMPL()
740 int r; in TEST_IMPL() local
747 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
748 ASSERT_OK(r); in TEST_IMPL()
750 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
751 ASSERT_OK(r); in TEST_IMPL()
762 int r; in TEST_IMPL() local
766 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
767 ASSERT_OK(r); in TEST_IMPL()
769 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL()
770 ASSERT_OK(r); in TEST_IMPL()
772 r = uv_timer_start(&timer, timer_cb, 500, 0); in TEST_IMPL()
773 ASSERT_OK(r); in TEST_IMPL()
775 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
776 ASSERT_OK(r); in TEST_IMPL()
787 int r; in TEST_IMPL() local
800 r = putenv("ENV_TEST=testval"); in TEST_IMPL()
801 ASSERT_OK(r); in TEST_IMPL()
806 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
807 ASSERT_OK(r); in TEST_IMPL()
809 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
810 ASSERT_OK(r); in TEST_IMPL()
812 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
813 ASSERT_OK(r); in TEST_IMPL()
827 int r; in TEST_IMPL() local
833 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
834 ASSERT_OK(r); in TEST_IMPL()
838 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
839 ASSERT_OK(r); in TEST_IMPL()
845 r = uv_kill(process.pid, 0); in TEST_IMPL()
846 ASSERT_OK(r); in TEST_IMPL()
848 r = uv_kill(process.pid, SIGTERM); in TEST_IMPL()
849 ASSERT_OK(r); in TEST_IMPL()
856 int r; in TEST_IMPL() local
866 r = uv_pipe_init(uv_default_loop(), &in, 0); in TEST_IMPL()
867 ASSERT_OK(r); in TEST_IMPL()
869 r = uv_pipe_init(uv_default_loop(), &out, 0); in TEST_IMPL()
870 ASSERT_OK(r); in TEST_IMPL()
872 r = uv_pipe_init(uv_default_loop(), &err, 0); in TEST_IMPL()
873 ASSERT_OK(r); in TEST_IMPL()
884 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
885 ASSERT_OK(r); in TEST_IMPL()
888 r = uv_write(&write, (uv_stream_t*) &in, &buf, 1, write_cb); in TEST_IMPL()
889 ASSERT_OK(r); in TEST_IMPL()
891 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
892 ASSERT_OK(r); in TEST_IMPL()
894 r = uv_read_start((uv_stream_t*) &err, on_alloc, on_read); in TEST_IMPL()
895 ASSERT_OK(r); in TEST_IMPL()
897 r = uv_timer_init(uv_default_loop(), &timer); in TEST_IMPL()
898 ASSERT_OK(r); in TEST_IMPL()
900 r = uv_timer_start(&timer, timer_cb, 500, 0); in TEST_IMPL()
901 ASSERT_OK(r); in TEST_IMPL()
903 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
904 ASSERT_OK(r); in TEST_IMPL()
919 int r; in TEST_IMPL() local
933 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
934 ASSERT_OK(r); in TEST_IMPL()
939 r = uv_process_kill(&process, 0); in TEST_IMPL()
940 ASSERT_OK(r); in TEST_IMPL()
942 r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); in TEST_IMPL()
943 ASSERT_OK(r); in TEST_IMPL()
945 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
946 ASSERT_OK(r); in TEST_IMPL()
950 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
951 ASSERT_OK(r); in TEST_IMPL()
966 int r; in TEST_IMPL() local
980 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
981 ASSERT_OK(r); in TEST_IMPL()
986 r = uv_process_kill(&process, 0); in TEST_IMPL()
987 ASSERT_OK(r); in TEST_IMPL()
989 r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); in TEST_IMPL()
990 ASSERT_OK(r); in TEST_IMPL()
992 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
993 ASSERT_OK(r); in TEST_IMPL()
997 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
998 ASSERT_OK(r); in TEST_IMPL()
1041 int r; in TEST_IMPL() local
1060 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1061 ASSERT_OK(r); in TEST_IMPL()
1076 r = uv_kill(process.pid, 0); in TEST_IMPL()
1077 ASSERT_OK(r); in TEST_IMPL()
1080 r = uv_kill(process.pid, SIGTERM); in TEST_IMPL()
1081 ASSERT_OK(r); in TEST_IMPL()
1083 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1084 ASSERT_OK(r); in TEST_IMPL()
1096 int r; in TEST_IMPL() local
1127 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1128 ASSERT_OK(r); in TEST_IMPL()
1130 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
1131 ASSERT_OK(r); in TEST_IMPL()
1133 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1134 ASSERT_OK(r); in TEST_IMPL()
1353 int r; in TEST_IMPL() local
1363 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1364 ASSERT(r == UV_ENOENT || r == UV_EACCES); in TEST_IMPL()
1424 int r; in TEST_IMPL() local
1452 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1453 ASSERT(r == UV_ENOENT || r == UV_EACCES); in TEST_IMPL()
1465 int r; in TEST_IMPL() local
1489 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1490 if (r == UV_EACCES) in TEST_IMPL()
1493 ASSERT_OK(r); in TEST_IMPL()
1495 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1496 ASSERT_OK(r); in TEST_IMPL()
1509 int r; in TEST_IMPL() local
1542 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1544 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
1546 ASSERT_EQ(r, UV_EPERM); in TEST_IMPL()
1549 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1550 ASSERT_OK(r); in TEST_IMPL()
1560 int r; in TEST_IMPL() local
1587 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1589 ASSERT_EQ(r, UV_EINVAL); in TEST_IMPL()
1591 ASSERT_EQ(r, UV_EPERM); in TEST_IMPL()
1594 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1595 ASSERT_OK(r); in TEST_IMPL()
1615 int r; in TEST_IMPL() local
1622 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1623 ASSERT_EQ(r, UV_ENOTSUP); in TEST_IMPL()
1625 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1626 ASSERT_OK(r); in TEST_IMPL()
1636 int r; in TEST_IMPL() local
1643 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1644 ASSERT_EQ(r, UV_ENOTSUP); in TEST_IMPL()
1646 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1647 ASSERT_OK(r); in TEST_IMPL()
1671 int r; in TEST_IMPL() local
1688 r = uv_fs_open(NULL, &fs_req, dev_null, UV_FS_O_RDWR, 0, NULL); in TEST_IMPL()
1689 ASSERT_NE(r, -1); in TEST_IMPL()
1729 ASSERT_OK(uv_fs_close(NULL, &fs_req, r, NULL)); in TEST_IMPL()
1814 int r; in TEST_IMPL() local
1869 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
1870 ASSERT_OK(r); in TEST_IMPL()
1872 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
1873 ASSERT_OK(r); in TEST_IMPL()
1894 int r; in TEST_IMPL() local
1943 r = uv_write(&write_req, in TEST_IMPL()
1948 ASSERT_OK(r); in TEST_IMPL()
1950 r = uv_read_start((uv_stream_t*) &pipe_stdout_parent, on_alloc, on_read); in TEST_IMPL()
1951 ASSERT_OK(r); in TEST_IMPL()
1953 r = uv_run(loop, UV_RUN_DEFAULT); in TEST_IMPL()
1954 ASSERT_OK(r); in TEST_IMPL()
1959 r = memcmp(ubuf, output, sizeof ubuf); in TEST_IMPL()
1960 ASSERT_OK(r); in TEST_IMPL()
1992 int r; in TEST_IMPL() local
2000 r = uv_spawn(uv_default_loop(), &process, &options); in TEST_IMPL()
2001 ASSERT_OK(r); in TEST_IMPL()
2013 r = uv_spawn(uv_default_loop(), &dummy_processes[i], &dummy_options); in TEST_IMPL()
2014 if (r != UV_ENOENT) in TEST_IMPL()
2015 ASSERT_EQ(r, UV_EACCES); in TEST_IMPL()
2019 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in TEST_IMPL()
2020 ASSERT_OK(r); in TEST_IMPL()
2035 ssize_t r, w, c; in spawn_stdin_stdout() local
2037 r = read(0, buf, sizeof buf); in spawn_stdin_stdout()
2038 } while (r == -1 && errno == EINTR); in spawn_stdin_stdout()
2039 if (r == 0) { in spawn_stdin_stdout()
2042 ASSERT_GT(r, 0); in spawn_stdin_stdout()
2043 c = r; in spawn_stdin_stdout()