Lines Matching refs:r

147     int r;  in blk_rw()  local
156 r = write(fd, buf, len); in blk_rw()
158 r = read(fd, buf, len); in blk_rw()
160 if (r < 0) in blk_rw()
164 r = 0; in blk_rw()
166 return r; in blk_rw()
294 int r; in gpt2_set_boot_chain() local
299 r = -1; in gpt2_set_boot_chain()
305 r = -1; in gpt2_set_boot_chain()
312 r = -1; in gpt2_set_boot_chain()
317 r = blk_rw(fd, 0, blk_size, gpt_header, blk_size); in gpt2_set_boot_chain()
319 if (r) { in gpt2_set_boot_chain()
333 r = -1; in gpt2_set_boot_chain()
337 r = blk_rw(fd, 0, pentries_start_offset, pentries, pentries_array_size); in gpt2_set_boot_chain()
338 if (r) in gpt2_set_boot_chain()
344 r = -1; in gpt2_set_boot_chain()
349 r = blk_rw(fd, 0, gpt2_header_offset, gpt_header, blk_size); in gpt2_set_boot_chain()
350 if (r) in gpt2_set_boot_chain()
358 r = gpt_boot_chain_swap(pentries, pentries + pentries_array_size, in gpt2_set_boot_chain()
360 if (r) in gpt2_set_boot_chain()
373 r = blk_rw(fd, 1, gpt2_header_offset, gpt_header, blk_size); in gpt2_set_boot_chain()
374 if (!r) in gpt2_set_boot_chain()
376 r = blk_rw(fd, 1, pentries_start_offset, pentries, in gpt2_set_boot_chain()
384 return r; in gpt2_set_boot_chain()
744 int r = 0; in prepare_partitions() local
754 r = -1; in prepare_partitions()
763 r = -1; in prepare_partitions()
766 r = gpt_get_state(fd, PRIMARY_GPT, &gpt_prim) || in prepare_partitions()
768 if (r) { in prepare_partitions()
778 r = -1; in prepare_partitions()
784 r = -1; in prepare_partitions()
798 r = -1; in prepare_partitions()
807 r = -1; in prepare_partitions()
824 r = gpt_utils_set_xbl_boot_partition(BACKUP_BOOT); in prepare_partitions()
825 if(r){ in prepare_partitions()
836 r = gpt2_set_boot_chain(fd, BACKUP_BOOT); in prepare_partitions()
837 if (r) { in prepare_partitions()
838 if (r < 0) in prepare_partitions()
844 r = 0; in prepare_partitions()
849 r = gpt_set_state(fd, PRIMARY_GPT, GPT_BAD_SIGNATURE); in prepare_partitions()
850 if (r) { in prepare_partitions()
868 r = gpt_utils_set_xbl_boot_partition(NORMAL_BOOT); in prepare_partitions()
869 if(r) { in prepare_partitions()
879 r = gpt_set_state(fd, PRIMARY_GPT, GPT_OK); in prepare_partitions()
880 if (r) { in prepare_partitions()
886 r = gpt_set_state(fd, SECONDARY_GPT, GPT_BAD_SIGNATURE); in prepare_partitions()
887 if (r) { in prepare_partitions()
899 r = gpt2_set_boot_chain(fd, NORMAL_BOOT); in prepare_partitions()
900 if (r < 0) { in prepare_partitions()
906 r = gpt_set_state(fd, SECONDARY_GPT, GPT_OK); in prepare_partitions()
907 if (r) { in prepare_partitions()
921 return r; in prepare_partitions()