platform_system_core/adb
Teddie Stenvi 8f5daadcc1 Fix ADB daemon file descriptor leak
The ADB (Android Debug Bridge) daemon suffers from a file descriptor leak.
When transfering file descriptors, opened by the adbd daemon, to a JDWP
process for debugging through sendmsg, the file descriptor is duplicated
by the kernel and a copy is transfered to the JDWP process.
Adbd neglects to close it's copy of the descriptor after the sendmsg call
which causes a file descriptor leak in the process.
Eventually this causes the daemon to hit its maximum roof of opened file
descriptors thus making it impossible for the process to serve any new
commands from the adb server.
Jdwp_service.c has been modified to close the file descriptor after the
send message call has succeded.
Also, the socket used for transfering the file descriptor is set to blocking
mode before the sendmsg call since the adbd processes needs to know when the
duplication has been completed by the kernel.
The flags are reset to its original state after the sendmsg call.

Change-Id: I76b15460301ac01e432f5ce8678ff58c658c16f2
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
2010-06-18 08:11:04 +00:00
..
Android.mk adb: remove obsolete shell history support. 2010-05-25 13:40:15 -04:00
MODULE_LICENSE_APACHE2 eclair snapshot 2009-11-12 18:46:23 -08:00
NOTICE eclair snapshot 2009-11-12 18:46:23 -08:00
OVERVIEW.TXT Fixing spelling errors in adb docs 2010-04-28 11:38:39 -04:00
SERVICES.TXT Fixing spelling errors in adb docs 2010-04-28 11:38:39 -04:00
adb.c adb connect and disconnect improvements: 2010-06-02 11:31:26 -04:00
adb.h adb connect and disconnect improvements: 2010-06-02 11:31:26 -04:00
adb_client.c Make adb's daemon-port on the host machine configurable. 2010-04-28 11:38:34 -04:00
adb_client.h Make adb's daemon-port on the host machine configurable. 2010-04-28 11:38:34 -04:00
commandline.c adb connect and disconnect improvements: 2010-06-02 11:31:26 -04:00
console.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
fdevent.c Cleaning up whitespace in adb sources. Nothing more, nothing less. 2009-05-18 17:36:28 +02:00
fdevent.h Cleaning up whitespace in adb sources. Nothing more, nothing less. 2009-05-18 17:36:28 +02:00
file_sync_client.c Add -l option to `adb sync` 2010-04-19 16:36:57 -07:00
file_sync_service.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
file_sync_service.h Add -l option to `adb sync` 2010-04-19 16:36:57 -07:00
framebuffer_service.c eclair snapshot 2009-11-12 18:46:23 -08:00
get_my_path_darwin.c eclair snapshot 2009-11-12 18:46:23 -08:00
get_my_path_freebsd.c FreeBSD support for usb-connected devices in adb 2009-10-25 01:56:35 +11:00
get_my_path_linux.c Make get_my_path() safer 2009-10-22 02:55:00 +11:00
get_my_path_windows.c Make get_my_path() safer 2009-10-22 02:55:00 +11:00
jdwp_service.c Fix ADB daemon file descriptor leak 2010-06-18 08:11:04 +00:00
log_service.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
mutex_list.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
protocol.txt Cleaning up whitespace in adb sources. Nothing more, nothing less. 2009-05-18 17:36:28 +02:00
remount_service.c Fix adb remount on non-MTD devices 2010-05-24 11:27:16 -04:00
services.c eclair snapshot 2009-11-12 18:46:23 -08:00
sockets.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
sockets.dia auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
sysdeps.h eclair snapshot 2009-11-12 18:46:23 -08:00
sysdeps_win32.c eclair snapshot 2009-11-12 18:46:23 -08:00
test_track_devices.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
test_track_jdwp.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
transport.c adb connect and disconnect improvements: 2010-06-02 11:31:26 -04:00
transport_local.c Let "adb connect" connect to emulators too 2010-05-24 11:27:16 -04:00
transport_usb.c eclair snapshot 2009-11-12 18:46:23 -08:00
usb_libusb.c FreeBSD support for usb-connected devices in adb 2009-10-25 01:56:35 +11:00
usb_linux.c adb: Add five second timeout for USB writes on Linux host. 2010-04-28 11:33:13 -04:00
usb_linux_client.c eclair snapshot 2009-11-12 18:46:23 -08:00
usb_osx.c eclair snapshot 2009-11-12 18:46:23 -08:00
usb_vendors.c adb: Add Qualcomm USB id 2010-05-24 11:02:17 -04:00
usb_vendors.h Support for 3rd party USB Vendor IDs in adb. 2009-05-22 15:25:25 -07:00
usb_windows.c eclair snapshot 2009-11-12 18:46:23 -08:00
utils.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
utils.h auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00