Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: device/bluetooth/bluetooth_socket_chromeos.cc

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/zygote/zygote_main_linux.cc ('k') | ipc/file_descriptor_set_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_socket_chromeos.h" 5 #include "device/bluetooth/bluetooth_socket_chromeos.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <poll.h> 8 #include <poll.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <sys/ioctl.h> 10 #include <sys/ioctl.h>
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 if (optval == SOCK_DGRAM || optval == SOCK_SEQPACKET) { 39 if (optval == SOCK_DGRAM || optval == SOCK_SEQPACKET) {
40 socket_type_ = L2CAP; 40 socket_type_ = L2CAP;
41 } else { 41 } else {
42 socket_type_ = RFCOMM; 42 socket_type_ = RFCOMM;
43 } 43 }
44 } 44 }
45 45
46 BluetoothSocketChromeOS::~BluetoothSocketChromeOS() { 46 BluetoothSocketChromeOS::~BluetoothSocketChromeOS() {
47 HANDLE_EINTR(close(fd_)); 47 close(fd_);
48 } 48 }
49 49
50 bool BluetoothSocketChromeOS::Receive(net::GrowableIOBuffer *buffer) { 50 bool BluetoothSocketChromeOS::Receive(net::GrowableIOBuffer *buffer) {
51 base::ThreadRestrictions::AssertIOAllowed(); 51 base::ThreadRestrictions::AssertIOAllowed();
52 52
53 if (socket_type_ == L2CAP) { 53 if (socket_type_ == L2CAP) {
54 int count; 54 int count;
55 if (ioctl(fd_, FIONREAD, &count) < 0) { 55 if (ioctl(fd_, FIONREAD, &count) < 0) {
56 error_message_ = safe_strerror(errno); 56 error_message_ = safe_strerror(errno);
57 LOG(WARNING) << "Unable to get waiting data size: " << error_message_; 57 LOG(WARNING) << "Unable to get waiting data size: " << error_message_;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 scoped_refptr<device::BluetoothSocket> BluetoothSocketChromeOS::Create( 158 scoped_refptr<device::BluetoothSocket> BluetoothSocketChromeOS::Create(
159 dbus::FileDescriptor* fd) { 159 dbus::FileDescriptor* fd) {
160 DCHECK(fd->is_valid()); 160 DCHECK(fd->is_valid());
161 161
162 BluetoothSocketChromeOS* bluetooth_socket = 162 BluetoothSocketChromeOS* bluetooth_socket =
163 new BluetoothSocketChromeOS(fd->TakeValue());; 163 new BluetoothSocketChromeOS(fd->TakeValue());;
164 return scoped_refptr<BluetoothSocketChromeOS>(bluetooth_socket); 164 return scoped_refptr<BluetoothSocketChromeOS>(bluetooth_socket);
165 } 165 }
166 166
167 } // namespace chromeos 167 } // namespace chromeos
OLDNEW
« no previous file with comments | « content/zygote/zygote_main_linux.cc ('k') | ipc/file_descriptor_set_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698