Lines Matching refs:err
217 int err; in write_update_file() local
233 err = dataStream->WriteEntityHeader(key, bytesLeft); in write_update_file()
234 if (err != 0) { in write_update_file()
236 return err; in write_update_file()
243 err = dataStream->WriteEntityData(&metadata, sizeof(metadata)); in write_update_file()
244 if (err != 0) { in write_update_file()
246 return err; in write_update_file()
256 err = dataStream->WriteEntityData(buf, amt); in write_update_file()
257 if (err != 0) { in write_update_file()
259 return err; in write_update_file()
270 err = dataStream->WriteEntityData(buf, amt); in write_update_file()
271 if (err != 0) { in write_update_file()
273 return err; in write_update_file()
288 int err; in write_update_file() local
291 err = stat(realFilename, &st); in write_update_file()
292 if (err < 0) { in write_update_file()
301 err = write_update_file(dataStream, fd, st.st_mode, key, realFilename); in write_update_file()
303 return err; in write_update_file()
336 int err; in back_up_files() local
341 err = read_snapshot_file(oldSnapshotFD, &oldSnapshot); in back_up_files()
342 if (err != 0) { in back_up_files()
355 err = stat(file, &st); in back_up_files()
356 if (err != 0) { in back_up_files()
439 err = write_snapshot_file(newSnapshotFD, newSnapshot); in back_up_files()
515 int err = 0; in write_tarfile() local
518 err = errno; in write_tarfile()
519 ALOGE("Error %d (%s) from lstat64(%s)", err, strerror(err), filepath.string()); in write_tarfile()
520 return err; in write_tarfile()
546 err = errno; in write_tarfile()
547 ALOGE("Error %d (%s) from open(%s)", err, strerror(err), filepath.string()); in write_tarfile()
548 return err; in write_tarfile()
563 err = ENOMEM; in write_tarfile()
693 err = errno; in write_tarfile()
695 err, strerror(err)); in write_tarfile()
700 err = EIO; in write_tarfile()
722 return err; in write_tarfile()
744 ssize_t err; in WriteFile() local
755 err = in->ReadEntityHeader(&key, &dataSize); in WriteFile()
756 if (err != NO_ERROR) { in WriteFile()
757 return err; in WriteFile()
789 err = write(fd, buf, amt); in WriteFile()
790 if (err != amt) { in WriteFile()
801 err = stat(filename.string(), &st); in WriteFile()
802 if (err != 0) { in WriteFile()
906 int err; in backup_helper_test_empty() local
921 err = write_snapshot_file(fd, snapshot); in backup_helper_test_empty()
925 if (err != 0) { in backup_helper_test_empty()
926 fprintf(stderr, "write_snapshot_file reported error %d (%s)\n", err, strerror(err)); in backup_helper_test_empty()
927 return err; in backup_helper_test_empty()
935 err = compare_file(filename, correct_data, sizeof(correct_data)); in backup_helper_test_empty()
936 if (err != 0) { in backup_helper_test_empty()
937 return err; in backup_helper_test_empty()
948 err = read_snapshot_file(fd, &readSnapshot); in backup_helper_test_empty()
949 if (err != 0) { in backup_helper_test_empty()
950 fprintf(stderr, "read_snapshot_file failed %d\n", err); in backup_helper_test_empty()
951 return err; in backup_helper_test_empty()
965 int err; in backup_helper_test_four() local
1025 err = write_snapshot_file(fd, snapshot); in backup_helper_test_four()
1029 if (err != 0) { in backup_helper_test_four()
1030 fprintf(stderr, "write_snapshot_file reported error %d (%s)\n", err, strerror(err)); in backup_helper_test_four()
1031 return err; in backup_helper_test_four()
1071 err = compare_file(filename, correct_data, sizeof(correct_data)); in backup_helper_test_four()
1072 if (err != 0) { in backup_helper_test_four()
1073 return err; in backup_helper_test_four()
1085 err = read_snapshot_file(fd, &readSnapshot); in backup_helper_test_four()
1086 if (err != 0) { in backup_helper_test_four()
1087 fprintf(stderr, "read_snapshot_file failed %d\n", err); in backup_helper_test_four()
1088 return err; in backup_helper_test_four()
1146 int err; in test_write_header_and_entity() local
1149 err = writer.WriteEntityHeader(text, text.length()+1); in test_write_header_and_entity()
1150 if (err != 0) { in test_write_header_and_entity()
1151 fprintf(stderr, "WriteEntityHeader failed with %s\n", strerror(err)); in test_write_header_and_entity()
1152 return err; in test_write_header_and_entity()
1155 err = writer.WriteEntityData(text.string(), text.length()+1); in test_write_header_and_entity()
1156 if (err != 0) { in test_write_header_and_entity()
1161 return err; in test_write_header_and_entity()
1167 int err; in backup_helper_test_data_writer() local
1183 err = 0; in backup_helper_test_data_writer()
1184 err |= test_write_header_and_entity(writer, "no_padding_"); in backup_helper_test_data_writer()
1185 err |= test_write_header_and_entity(writer, "padded_to__3"); in backup_helper_test_data_writer()
1186 err |= test_write_header_and_entity(writer, "padded_to_2__"); in backup_helper_test_data_writer()
1187 err |= test_write_header_and_entity(writer, "padded_to1"); in backup_helper_test_data_writer()
1191 err = compare_file(filename, DATA_GOLDEN_FILE, DATA_GOLDEN_FILE_SIZE); in backup_helper_test_data_writer()
1192 if (err != 0) { in backup_helper_test_data_writer()
1193 return err; in backup_helper_test_data_writer()
1196 return err; in backup_helper_test_data_writer()
1202 int err; in test_read_header_and_entity() local
1213 err = reader.ReadNextHeader(&done, &type); in test_read_header_and_entity()
1218 if (err != 0) { in test_read_header_and_entity()
1219 fprintf(stderr, "ReadNextHeader (for app header) failed with %s\n", strerror(err)); in test_read_header_and_entity()
1223 err = EINVAL; in test_read_header_and_entity()
1227 err = reader.ReadEntityHeader(&string, &actualSize); in test_read_header_and_entity()
1228 if (err != 0) { in test_read_header_and_entity()
1229 fprintf(stderr, "ReadEntityHeader failed with %s\n", strerror(err)); in test_read_header_and_entity()
1234 err = EINVAL; in test_read_header_and_entity()
1240 err = EINVAL; in test_read_header_and_entity()
1246 err = reader.Status(); in test_read_header_and_entity()
1247 fprintf(stderr, "ReadEntityData failed with %s\n", strerror(err)); in test_read_header_and_entity()
1255 err = EINVAL; in test_read_header_and_entity()
1262 if (err != NO_ERROR) { in test_read_header_and_entity()
1263 fprintf(stderr, "test_read_header_and_entity failed with %s\n", strerror(err)); in test_read_header_and_entity()
1266 return err; in test_read_header_and_entity()
1272 int err; in backup_helper_test_data_reader() local
1286 err = write(fd, DATA_GOLDEN_FILE, DATA_GOLDEN_FILE_SIZE); in backup_helper_test_data_reader()
1287 if (err != DATA_GOLDEN_FILE_SIZE) { in backup_helper_test_data_reader()
1304 err = 0; in backup_helper_test_data_reader()
1306 if (err == NO_ERROR) { in backup_helper_test_data_reader()
1307 err = test_read_header_and_entity(reader, "no_padding_"); in backup_helper_test_data_reader()
1310 if (err == NO_ERROR) { in backup_helper_test_data_reader()
1311 err = test_read_header_and_entity(reader, "padded_to__3"); in backup_helper_test_data_reader()
1314 if (err == NO_ERROR) { in backup_helper_test_data_reader()
1315 err = test_read_header_and_entity(reader, "padded_to_2__"); in backup_helper_test_data_reader()
1318 if (err == NO_ERROR) { in backup_helper_test_data_reader()
1319 err = test_read_header_and_entity(reader, "padded_to1"); in backup_helper_test_data_reader()
1325 return err; in backup_helper_test_data_reader()
1331 int err; in get_mod_time() local
1333 err = stat64(filename, &st); in get_mod_time()
1334 if (err != 0) { in get_mod_time()
1351 int err; in backup_helper_test_files() local
1398 err = back_up_files(-1, &dataStream, newSnapshotFD, files_before, keys_before, 5); in backup_helper_test_files()
1399 if (err != 0) { in backup_helper_test_files()
1400 return err; in backup_helper_test_files()
1412 err = get_mod_time(SCRATCH_DIR "data/d", d_times); in backup_helper_test_files()
1413 err |= get_mod_time(SCRATCH_DIR "data/e", e_times); in backup_helper_test_files()
1414 if (err != 0) { in backup_helper_test_files()
1415 return err; in backup_helper_test_files()
1467 err = back_up_files(oldSnapshotFD, &dataStream, newSnapshotFD, files_after, keys_after, 6); in backup_helper_test_files()
1468 if (err != 0) { in backup_helper_test_files()
1469 return err; in backup_helper_test_files()
1483 int err; in backup_helper_test_null_base() local
1516 err = back_up_files(-1, &dataStream, newSnapshotFD, files, keys, 1); in backup_helper_test_null_base()
1517 if (err != 0) { in backup_helper_test_null_base()
1518 return err; in backup_helper_test_null_base()
1531 int err; in backup_helper_test_missing_file() local
1568 err = back_up_files(-1, &dataStream, newSnapshotFD, files, keys, 1); in backup_helper_test_missing_file()
1569 if (err != 0) { in backup_helper_test_missing_file()
1570 return err; in backup_helper_test_missing_file()