Lines Matching refs:res
141 int res = stat(path, &stbuf);
142 if (res == -1) {
167 int res = lstat(path, &stbuf);
168 if (res == -1) {
188 int res = lstat(path, &stbuf);
189 if (res == -1) {
207 int res = lstat(path, &stbuf);
208 if (res == -1) {
231 int res = fstat(fd, &stbuf);
232 if (res == -1) {
264 int res = lstat(path, &stbuf);
265 if (res == -1) {
275 int res = fstat(fd, &stbuf);
276 if (res == -1) {
300 int res = lstat(path, &stbuf);
301 if (res == 0) {
325 int res;
338 res = read(fd, buf, rdlen);
339 if (res == -1) {
344 if (res != rdlen) {
345 ERROR("short read: %u instead of %u", res, rdlen);
356 res = close(fd);
357 if (res == -1) {
368 int res;
375 res = read(fd, buf, rdlen);
376 if (res == -1) {
380 if (res != rdlen) {
381 ERROR("short read: %u instead of %u", res, rdlen);
396 int res;
452 res = closedir(dp);
453 if (res == -1) {
465 int res;
475 res = write(fd, data, len);
476 if (res == -1) {
481 if (res != len) {
482 ERROR("write is short: %u instead of %u", res, len);
487 res = close(fd);
488 if (res == -1) {
492 res = check_type(path, S_IFREG);
493 if (res == -1)
495 res = check_mode(path, 0644);
496 if (res == -1)
498 res = check_nlink(path, 1);
499 if (res == -1)
501 res = check_size(path, len);
502 if (res == -1)
506 res = check_data(path, data, 0, len);
507 if (res == -1)
517 int res;
519 res = create_file(path, data, len);
520 if (res == -1)
535 int res, fd;
548 res = fstat(fd, st);
549 if (res == -1) {
569 int res, err = 0;
583 res = close(fd);
584 if (res == -1) {
604 int res;
607 res = unlink(fpath);
608 if (res == -1 && !quiet) {
621 int res;
625 res = mkdir(path, 0755);
626 if (res == -1) {
630 res = check_type(path, S_IFDIR);
631 if (res == -1)
633 res = check_mode(path, 0755);
634 if (res == -1)
640 res = create_file(fpath, "", 0);
641 if (res == -1) {
646 res = check_dir_contents(path, dir_files);
647 if (res == -1) {
659 int res;
662 res = create_testfile(testfile, data, datalen);
663 if (res == -1)
666 res = truncate(testfile, len);
667 if (res == -1) {
671 res = check_testfile_size(testfile, len);
672 if (res == -1)
677 res = check_data(testfile, data, 0, len);
678 if (res == -1)
681 res = check_data(testfile, data, 0, datalen);
682 if (res == -1)
684 res = check_data(testfile, zerodata, datalen,
686 if (res == -1)
690 res = unlink(testfile);
691 if (res == -1) {
695 res = check_nonexist(testfile);
696 if (res == -1)
707 int res;
711 res = create_testfile(testfile, data, datalen);
712 if (res == -1)
721 res = fchmod(fd, mode);
722 if (res == -1) {
727 res = check_testfile_mode(testfile, mode);
728 if (res == -1) {
732 res = ftruncate(fd, len);
733 if (res == -1) {
739 res = check_testfile_size(testfile, len);
740 if (res == -1)
745 res = check_data(testfile, data, 0, len);
746 if (res == -1)
749 res = check_data(testfile, data, 0, datalen);
750 if (res == -1)
752 res = check_data(testfile, zerodata, datalen,
754 if (res == -1)
758 res = unlink(testfile);
759 if (res == -1) {
763 res = check_nonexist(testfile);
764 if (res == -1)
774 int res;
779 res = create_dir(testdir, testdir_files);
780 if (res == -1)
781 return res;
818 res = cleanup_dir(testdir, testdir_files, 0);
819 if (!res)
821 return res;
834 int res;
845 res = write(fd_in, data, datalen);
846 if (res == -1) {
851 if (res != datalen) {
852 ERROR("write is short: %u instead of %u", res, datalen);
864 res = copy_file_range(fd_in, &pos_in, fd_out, &pos_out, datalen, 0);
865 if (res == -1) {
871 if (res != datalen) {
872 ERROR("copy is short: %u instead of %u", res, datalen);
878 res = close(fd_in);
879 if (res == -1) {
884 res = close(fd_out);
885 if (res == -1) {
892 res = unlink(testfile);
893 if (res == -1) {
897 res = check_nonexist(testfile);
898 if (res == -1)
903 res = unlink(testfile2);
904 if (res == -1) {
908 res = check_nonexist(testfile2);
909 if (res == -1)
929 int res;
932 res = create_testfile(testfile, NULL, 0);
933 if (res == -1)
938 res = utime(testfile, &utm);
939 if (res == -1) {
943 res = check_times(testfile, atime, mtime);
944 if (res == -1) {
947 res = unlink(testfile);
948 if (res == -1) {
952 res = check_nonexist(testfile);
953 if (res == -1)
965 int res;
975 res = write(fd, data, datalen);
976 if (res == -1) {
981 if (res != datalen) {
982 ERROR("write is short: %u instead of %u", res, datalen);
986 res = close(fd);
987 if (res == -1) {
991 res = check_type(testfile, S_IFREG);
992 if (res == -1)
998 res = unlink(testfile);
999 if (res == -1) {
1003 res = check_nonexist(testfile);
1004 if (res == -1)
1018 int res;
1028 res = unlink(testfile);
1029 if (res == -1) {
1034 res = check_nonexist(testfile);
1035 if (res == -1) {
1039 res = write(fd, data, datalen);
1040 if (res == -1) {
1045 if (res != datalen) {
1046 ERROR("write is short: %u instead of %u", res, datalen);
1056 res = close(fd);
1057 if (res == -1) {
1072 int res;
1076 res = mknod(testfile, 0644, 0);
1077 if (res == -1) {
1081 res = check_type(testfile, S_IFREG);
1082 if (res == -1)
1087 res = unlink(testfile);
1088 if (res == -1) {
1092 res = check_nonexist(testfile);
1093 if (res == -1)
1112 int res;
1119 res = create_file(testfile_r, testdata2, testdata2len);
1120 if (res == -1)
1161 res = write(fd, data, datalen);
1163 if (res == -1) {
1166 } else if (res != datalen) {
1167 ERROR("write is short: %u instead of %u", res, datalen);
1186 if (res != -1) {
1202 res = read(fd, buf, sizeof(buf));
1204 if (res == -1) {
1210 if (res != readsize) {
1212 res, readsize);
1228 if (res != -1) {
1237 res = close(fd);
1238 if (res == -1) {
1242 res = unlink(testfile);
1243 if (res == -1) {
1247 res = check_nonexist(testfile);
1248 if (res == -1)
1250 res = check_nonexist(testfile_r);
1251 if (res == -1)
1268 int res;
1274 res = create_testfile(testfile, data, datalen);
1275 if (res == -1)
1278 res = chmod(testfile, mode);
1279 if (res == -1) {
1284 res = check_testfile_mode(testfile, mode);
1285 if (res == -1)
1303 res = unlink(testfile);
1304 if (res == -1) {
1308 res = check_nonexist(testfile);
1309 if (res == -1)
1311 res = check_nonexist(testfile_r);
1312 if (res == -1)
1326 int res;
1329 res = create_testfile(testfile, data, datalen);
1330 if (res == -1)
1334 res = symlink(testfile, testfile2);
1335 if (res == -1) {
1339 res = check_type(testfile2, S_IFLNK);
1340 if (res == -1)
1344 res = readlink(testfile2, buf, sizeof(buf));
1345 if (res == -1) {
1349 if (res != linklen) {
1350 ERROR("short readlink: %u instead of %u", res, linklen);
1359 res = unlink(testfile2);
1360 if (res == -1) {
1364 res = check_nonexist(testfile2);
1365 if (res == -1)
1370 res = unlink(testfile);
1371 if (res == -1) {
1375 res = check_nonexist(testfile);
1376 if (res == -1)
1388 int res;
1391 res = create_testfile(testfile, data, datalen);
1392 if (res == -1)
1396 res = link(testfile, testfile2);
1397 if (res == -1) {
1401 res = check_type(testfile2, S_IFREG);
1402 if (res == -1)
1408 res = unlink(testfile);
1409 if (res == -1) {
1413 res = check_nonexist(testfile);
1414 if (res == -1)
1418 res = unlink(testfile2);
1419 if (res == -1) {
1423 res = check_nonexist(testfile2);
1424 if (res == -1)
1438 int res;
1441 res = create_testfile(testfile, data, datalen);
1442 if (res == -1)
1446 res = link(testfile, testfile2);
1447 if (res == -1) {
1451 res = unlink(testfile);
1452 if (res == -1) {
1456 res = check_nonexist(testfile);
1457 if (res == -1)
1459 res = link(testfile2, testfile);
1460 if (res == -1) {
1463 res = check_type(testfile, S_IFREG);
1464 if (res == -1)
1471 res = unlink(testfile2);
1472 if (res == -1) {
1477 res = unlink(testfile);
1478 if (res == -1) {
1482 res = check_nonexist(testfile);
1483 if (res == -1)
1497 int res;
1500 res = create_testfile(testfile, data, datalen);
1501 if (res == -1)
1505 res = rename(testfile, testfile2);
1506 if (res == -1) {
1510 res = check_nonexist(testfile);
1511 if (res == -1)
1513 res = check_type(testfile2, S_IFREG);
1514 if (res == -1)
1520 res = unlink(testfile2);
1521 if (res == -1) {
1525 res = check_nonexist(testfile2);
1526 if (res == -1)
1538 int res;
1541 res = create_dir(testdir, testdir_files);
1542 if (res == -1)
1546 res = rename(testdir, testdir2);
1547 if (res == -1) {
1552 res = check_nonexist(testdir);
1553 if (res == -1) {
1557 res = check_type(testdir2, S_IFDIR);
1558 if (res == -1) {
1565 res = rmdir(testdir2);
1566 if (res == -1) {
1570 res = check_nonexist(testdir2);
1571 if (res == -1)
1587 int res;
1591 res = create_dir(testdir, testdir_files);
1592 if (res == -1)
1595 res = mkdir(PATH("a"), 0755);
1596 if (res == -1) {
1601 res = rename(PATH("a"), PATH2("a"));
1602 if (res == -1) {
1608 res = rename(PATH("a"), PATH2("a/b"));
1609 if (res == 0 || errno != EINVAL) {
1614 res = mkdir(PATH("a/b"), 0755);
1615 if (res == -1) {
1620 res = mkdir(PATH("a/b/c"), 0755);
1621 if (res == -1) {
1627 res = rename(PATH("a"), PATH2("a/b/c"));
1628 if (res == 0 || errno != EINVAL) {
1634 res = rename(PATH("a"), PATH2("a/b/c/a"));
1635 if (res == 0 || errno != EINVAL) {
1641 res = rename(PATH("a/b/c"), PATH2("a"));
1642 if (res == 0 || errno != ENOTEMPTY) {
1647 res = open(PATH("a/foo"), O_CREAT, 0644);
1648 if (res == -1) {
1652 close(res);
1654 res = rename(PATH("a/foo"), PATH2("a/bar"));
1655 if (res == -1) {
1660 res = rename(PATH("a/bar"), PATH2("a/foo"));
1661 if (res == -1) {
1666 res = rename(PATH("a/foo"), PATH2("a/b/bar"));
1667 if (res == -1) {
1672 res = rename(PATH("a/b/bar"), PATH2("a/foo"));
1673 if (res == -1) {
1678 res = rename(PATH("a/foo"), PATH2("a/b/c/bar"));
1679 if (res == -1) {
1684 res = rename(PATH("a/b/c/bar"), PATH2("a/foo"));
1685 if (res == -1) {
1690 res = open(PATH("a/bar"), O_CREAT, 0644);
1691 if (res == -1) {
1695 close(res);
1697 res = rename(PATH("a/foo"), PATH2("a/bar"));
1698 if (res == -1) {
1705 res = rename(PATH("a/b"), PATH2("a/d"));
1706 if (res == -1) {
1711 res = rename(PATH("a/d"), PATH2("a/b"));
1712 if (res == -1) {
1717 res = mkdir(PATH("a/d"), 0755);
1718 if (res == -1) {
1723 res = rename(PATH("a/b"), PATH2("a/d"));
1724 if (res == -1) {
1729 res = rename(PATH("a/d"), PATH2("a/b"));
1730 if (res == -1) {
1735 res = mkdir(PATH("a/d"), 0755);
1736 if (res == -1) {
1741 res = mkdir(PATH("a/d/e"), 0755);
1742 if (res == -1) {
1748 res = rename(PATH("a/b"), PATH2("a/d"));
1749 if (res == 0 || (errno != ENOTEMPTY && errno != EEXIST)) {
1762 res = rmdir(testdir);
1763 if (res == -1) {
1767 res = check_nonexist(testdir);
1768 if (res == -1)
1798 int res;
1803 res = mkfifo(testfile, 0644);
1804 if (res == -1) {
1808 res = check_type(testfile, S_IFIFO);
1809 if (res == -1)
1813 res = unlink(testfile);
1814 if (res == -1) {
1818 res = check_nonexist(testfile);
1819 if (res == -1)
1831 int res;
1837 res = mkdir(testdir, 0755);
1838 if (res == -1) {
1842 res = check_type(testdir, S_IFDIR);
1843 if (res == -1)
1850 res = rmdir(testdir);
1851 if (res == -1) {
1855 res = check_nonexist(testdir);
1856 if (res == -1)
1869 int res;
1889 res = bind(fd, (struct sockaddr*)&su, sizeof(su));
1890 if (res == -1) {
1895 res = check_type(testsock, S_IFSOCK);
1896 if (res == -1) {
1902 res = unlink(testsock);
1903 if (res == -1) {
1907 res = check_nonexist(testsock);
1908 if (res == -1)
1922 int res;
1928 res = mkdir(testdir, 0555);
1929 if (res == -1) {
1940 res = check_nonexist(subfile);
1941 if (res == -1)
1945 res = rmdir(testdir);
1946 if (res == -1) {
1950 res = check_nonexist(testdir);
1951 if (res == -1)