summaryrefslogtreecommitdiff
path: root/adb/daemon/file_sync_service.cpp
diff options
context:
space:
mode:
authorIan Kasprzak <iankaz@google.com>2019-04-25 15:59:28 +0000
committerIan Kasprzak <iankaz@google.com>2019-04-25 15:59:28 +0000
commit2c58e1924a7bf1b44049764fddb40c1704dc288f (patch)
treeac108140764b894ac24b6dceba42f7061fd6424f /adb/daemon/file_sync_service.cpp
parent93d63c010ae24ff58acb70216bfcb93e3c73019a (diff)
Revert "Add a way to turn off unique_fd's operator int."
This reverts commit 93d63c010ae24ff58acb70216bfcb93e3c73019a. Reason for revert: b/131312539 - All aosp-master-with-phones phones failing boot / health check. Change-Id: Id4239f93484b7d6b8d9bcd355a59cbd40d9766e2
Diffstat (limited to 'adb/daemon/file_sync_service.cpp')
-rw-r--r--adb/daemon/file_sync_service.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/adb/daemon/file_sync_service.cpp b/adb/daemon/file_sync_service.cpp
index 9d5015119..e82a51f2b 100644
--- a/adb/daemon/file_sync_service.cpp
+++ b/adb/daemon/file_sync_service.cpp
@@ -235,8 +235,8 @@ static bool handle_send_file(int s, const char* path, uint32_t* timestamp, uid_t
unique_fd fd(adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode));
- if (posix_fadvise(fd.get(), 0, 0,
- POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE | POSIX_FADV_WILLNEED) < 0) {
+ if (posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE | POSIX_FADV_WILLNEED) <
+ 0) {
D("[ Failed to fadvise: %d ]", errno);
}
@@ -464,9 +464,8 @@ static bool do_recv(int s, const char* path, std::vector<char>& buffer) {
return false;
}
- int rc = posix_fadvise(fd.get(), 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE);
- if (rc != 0) {
- D("[ Failed to fadvise: %d ]", rc);
+ if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE) < 0) {
+ D("[ Failed to fadvise: %d ]", errno);
}
syncmsg msg;