diff options
author | Dan Albert | 2015-02-25 00:48:25 -0600 |
---|---|---|
committer | Dan Albert | 2015-02-25 17:08:15 -0600 |
commit | 432584fccc1455532d824c21ff578b3bfcef92ce (patch) | |
tree | 4557180d7c7f95c448471a1c174e65933a7b9f1d /minadbd | |
parent | 12fa5191e76d119f4f3998a4b8821f87aa4f9fad (diff) | |
download | platform-bootable-recovery-432584fccc1455532d824c21ff578b3bfcef92ce.tar.gz platform-bootable-recovery-432584fccc1455532d824c21ff578b3bfcef92ce.tar.xz platform-bootable-recovery-432584fccc1455532d824c21ff578b3bfcef92ce.zip |
Fix readx/writex names.
Change-Id: I9556960b8293ea0e81def8b73f88edadb68841e3
Diffstat (limited to 'minadbd')
-rw-r--r-- | minadbd/fuse_adb_provider.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/minadbd/fuse_adb_provider.c b/minadbd/fuse_adb_provider.c index 2386e82b..300e3c74 100644 --- a/minadbd/fuse_adb_provider.c +++ b/minadbd/fuse_adb_provider.c | |||
@@ -19,9 +19,11 @@ | |||
19 | #include <string.h> | 19 | #include <string.h> |
20 | #include <errno.h> | 20 | #include <errno.h> |
21 | 21 | ||
22 | #include "sysdeps.h" | ||
23 | |||
22 | #include "adb.h" | 24 | #include "adb.h" |
25 | #include "adb_io.h" | ||
23 | #include "fuse_sideload.h" | 26 | #include "fuse_sideload.h" |
24 | #include "transport.h" | ||
25 | 27 | ||
26 | struct adb_data { | 28 | struct adb_data { |
27 | int sfd; // file descriptor for the adb channel | 29 | int sfd; // file descriptor for the adb channel |
@@ -35,12 +37,12 @@ static int read_block_adb(void* cookie, uint32_t block, uint8_t* buffer, uint32_ | |||
35 | 37 | ||
36 | char buf[10]; | 38 | char buf[10]; |
37 | snprintf(buf, sizeof(buf), "%08u", block); | 39 | snprintf(buf, sizeof(buf), "%08u", block); |
38 | if (writex(ad->sfd, buf, 8) < 0) { | 40 | if (!WriteStringFully(ad->sfd, buf)) { |
39 | fprintf(stderr, "failed to write to adb host: %s\n", strerror(errno)); | 41 | fprintf(stderr, "failed to write to adb host: %s\n", strerror(errno)); |
40 | return -EIO; | 42 | return -EIO; |
41 | } | 43 | } |
42 | 44 | ||
43 | if (readx(ad->sfd, buffer, fetch_size) < 0) { | 45 | if (!WriteFdExactly(ad->sfd, buffer, fetch_size)) { |
44 | fprintf(stderr, "failed to read from adb host: %s\n", strerror(errno)); | 46 | fprintf(stderr, "failed to read from adb host: %s\n", strerror(errno)); |
45 | return -EIO; | 47 | return -EIO; |
46 | } | 48 | } |
@@ -51,7 +53,7 @@ static int read_block_adb(void* cookie, uint32_t block, uint8_t* buffer, uint32_ | |||
51 | static void close_adb(void* cookie) { | 53 | static void close_adb(void* cookie) { |
52 | struct adb_data* ad = (struct adb_data*)cookie; | 54 | struct adb_data* ad = (struct adb_data*)cookie; |
53 | 55 | ||
54 | writex(ad->sfd, "DONEDONE", 8); | 56 | WriteStringFully(ad->sfd, "DONEDONE"); |
55 | } | 57 | } |
56 | 58 | ||
57 | int run_adb_fuse(int sfd, uint64_t file_size, uint32_t block_size) { | 59 | int run_adb_fuse(int sfd, uint64_t file_size, uint32_t block_size) { |