summaryrefslogtreecommitdiffstats
path: root/minadbd/fuse_adb_provider.c
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-02-26 00:32:48 +0100
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-26 00:32:48 +0100
commit11020eae5b72c02bfaa70008111ea424e2c440f0 (patch)
treeca271d6324fa0ed91c5698e5670a56914c49b46d /minadbd/fuse_adb_provider.c
parentam 94cb7fdc: am d795dcc5: am 12fa5191: Merge "Remove _(GNU|XOPEN)_SORUCE makefile cruft." (diff)
parentam eef962bf: am 9255ad4a: Merge "Fix readx/writex names." (diff)
downloadandroid_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.tar
android_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.tar.gz
android_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.tar.bz2
android_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.tar.lz
android_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.tar.xz
android_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.tar.zst
android_bootable_recovery-11020eae5b72c02bfaa70008111ea424e2c440f0.zip
Diffstat (limited to 'minadbd/fuse_adb_provider.c')
-rw-r--r--minadbd/fuse_adb_provider.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/minadbd/fuse_adb_provider.c b/minadbd/fuse_adb_provider.c
index 2386e82bb..300e3c748 100644
--- a/minadbd/fuse_adb_provider.c
+++ b/minadbd/fuse_adb_provider.c
@@ -19,9 +19,11 @@
#include <string.h>
#include <errno.h>
+#include "sysdeps.h"
+
#include "adb.h"
+#include "adb_io.h"
#include "fuse_sideload.h"
-#include "transport.h"
struct adb_data {
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_
char buf[10];
snprintf(buf, sizeof(buf), "%08u", block);
- if (writex(ad->sfd, buf, 8) < 0) {
+ if (!WriteStringFully(ad->sfd, buf)) {
fprintf(stderr, "failed to write to adb host: %s\n", strerror(errno));
return -EIO;
}
- if (readx(ad->sfd, buffer, fetch_size) < 0) {
+ if (!WriteFdExactly(ad->sfd, buffer, fetch_size)) {
fprintf(stderr, "failed to read from adb host: %s\n", strerror(errno));
return -EIO;
}
@@ -51,7 +53,7 @@ static int read_block_adb(void* cookie, uint32_t block, uint8_t* buffer, uint32_
static void close_adb(void* cookie) {
struct adb_data* ad = (struct adb_data*)cookie;
- writex(ad->sfd, "DONEDONE", 8);
+ WriteStringFully(ad->sfd, "DONEDONE");
}
int run_adb_fuse(int sfd, uint64_t file_size, uint32_t block_size) {