Lines Matching refs:amt

89     int amt;  in read_snapshot_file()  local
92 amt = read(fd, &header, sizeof(header)); in read_snapshot_file()
93 if (amt != sizeof(header)) { in read_snapshot_file()
96 bytesRead += amt; in read_snapshot_file()
107 amt = read(fd, &file, sizeof(FileState)); in read_snapshot_file()
108 if (amt != sizeof(FileState)) { in read_snapshot_file()
112 bytesRead += amt; in read_snapshot_file()
119 amt = read(fd, filename, nameBufSize); in read_snapshot_file()
120 if (amt == nameBufSize) { in read_snapshot_file()
123 bytesRead += amt; in read_snapshot_file()
127 if (amt != nameBufSize) { in read_snapshot_file()
160 int amt; in write_snapshot_file() local
163 amt = write(fd, &header, sizeof(header)); in write_snapshot_file()
164 if (amt != sizeof(header)) { in write_snapshot_file()
175 amt = write(fd, &r.s, sizeof(FileState)); in write_snapshot_file()
176 if (amt != sizeof(FileState)) { in write_snapshot_file()
182 amt = write(fd, name.string(), nameLen); in write_snapshot_file()
183 if (amt != nameLen) { in write_snapshot_file()
190 amt = write(fd, &padding, paddingLen); in write_snapshot_file()
191 if (amt != paddingLen) { in write_snapshot_file()
218 int amt; in write_update_file() local
251 while ((amt = read(fd, buf, bufsize)) != 0 && bytesLeft > 0) { in write_update_file()
252 bytesLeft -= amt; in write_update_file()
254 amt += bytesLeft; // Plus a negative is minus. Don't write more than we promised. in write_update_file()
256 err = dataStream->WriteEntityData(buf, amt); in write_update_file()
268 amt = bytesLeft < bufsize ? bytesLeft : bufsize; in write_update_file()
269 bytesLeft -= amt; in write_update_file()
270 err = dataStream->WriteEntityData(buf, amt); in write_update_file()
314 int amt; in compute_crc32() local
321 while ((amt = read(fd, buf, bufsize)) != 0) { in compute_crc32()
322 crc = crc32(crc, (Bytef*)buf, amt); in compute_crc32()
749 ssize_t amt; in WriteFile() local
763 amt = in->ReadEntityData(&metadata, sizeof(metadata)); in WriteFile()
764 if (amt != sizeof(metadata)) { in WriteFile()
766 (long)amt, strerror(errno)); in WriteFile()
788 while ((amt = in->ReadEntityData(buf, RESTORE_BUF_SIZE)) > 0) { in WriteFile()
789 err = write(fd, buf, amt); in WriteFile()
790 if (err != amt) { in WriteFile()
795 crc = crc32(crc, (Bytef*)buf, amt); in WriteFile()
834 int amt; in write_text_file() local
845 amt = write(fd, data, len); in write_text_file()
846 if (amt != len) { in write_text_file()
860 int amt; in compare_file() local
875 amt = lseek(fd, 0, SEEK_END); in compare_file()
876 if (amt != len) { in compare_file()
877 fprintf(stderr, "compare_file file length should be %d, was %d\n", len, amt); in compare_file()
882 int readLen = amt < len ? amt : len; in compare_file()
883 amt = read(fd, contents, readLen); in compare_file()
884 if (amt != readLen) { in compare_file()
885 fprintf(stderr, "compare_file read expected %d bytes but got %d\n", len, amt); in compare_file()