Lines Matching refs:amt
93 int amt; in read_snapshot_file() local
96 amt = read(fd, &header, sizeof(header)); in read_snapshot_file()
97 if (amt != sizeof(header)) { in read_snapshot_file()
100 bytesRead += amt; in read_snapshot_file()
111 amt = read(fd, &file, sizeof(FileState)); in read_snapshot_file()
112 if (amt != sizeof(FileState)) { in read_snapshot_file()
116 bytesRead += amt; in read_snapshot_file()
123 amt = read(fd, filename, nameBufSize); in read_snapshot_file()
124 if (amt == nameBufSize) { in read_snapshot_file()
127 bytesRead += amt; in read_snapshot_file()
131 if (amt != nameBufSize) { in read_snapshot_file()
164 int amt; in write_snapshot_file() local
167 amt = write(fd, &header, sizeof(header)); in write_snapshot_file()
168 if (amt != sizeof(header)) { in write_snapshot_file()
179 amt = write(fd, &r.s, sizeof(FileState)); in write_snapshot_file()
180 if (amt != sizeof(FileState)) { in write_snapshot_file()
186 amt = write(fd, name.string(), nameLen); in write_snapshot_file()
187 if (amt != nameLen) { in write_snapshot_file()
194 amt = write(fd, &padding, paddingLen); in write_snapshot_file()
195 if (amt != paddingLen) { in write_snapshot_file()
222 int amt; in write_update_file() local
255 while ((amt = read(fd, buf, bufsize)) != 0 && bytesLeft > 0) { in write_update_file()
256 bytesLeft -= amt; in write_update_file()
258 amt += bytesLeft; // Plus a negative is minus. Don't write more than we promised. in write_update_file()
260 err = dataStream->WriteEntityData(buf, amt); in write_update_file()
272 amt = bytesLeft < bufsize ? bytesLeft : bufsize; in write_update_file()
273 bytesLeft -= amt; in write_update_file()
274 err = dataStream->WriteEntityData(buf, amt); in write_update_file()
318 int amt; in compute_crc32() local
325 while ((amt = read(fd, buf, bufsize)) != 0) { in compute_crc32()
326 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()