summaryrefslogtreecommitdiffstats
path: root/adb/framebuffer_service.c
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-02-24 15:51:19 -0800
committerDan Albert <danalbert@google.com>2015-02-24 21:30:22 -0800
commit7664901a355b959f312e9acff5a0fd31b7139623 (patch)
tree4eae06ed28a7a20c454d9f4b59c6798a06644dad /adb/framebuffer_service.c
parent5329d3fd54fa875bb7de78a8c40134cc63921c64 (diff)
downloadsystem_core-7664901a355b959f312e9acff5a0fd31b7139623.zip
system_core-7664901a355b959f312e9acff5a0fd31b7139623.tar.gz
system_core-7664901a355b959f312e9acff5a0fd31b7139623.tar.bz2
Move transport declarations into transport.h.
There are a few cloexec issues in here as an added bonus. Change-Id: I1699d719d733f47878bdba0454230cf5ab6a60b6
Diffstat (limited to 'adb/framebuffer_service.c')
-rw-r--r--adb/framebuffer_service.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/adb/framebuffer_service.c b/adb/framebuffer_service.c
index 61578aa..5665a56 100644
--- a/adb/framebuffer_service.c
+++ b/adb/framebuffer_service.c
@@ -14,21 +14,23 @@
* limitations under the License.
*/
-#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <linux/fb.h>
#include <stdio.h>
-#include <unistd.h>
+#include <stdlib.h>
#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <unistd.h>
-#include "fdevent.h"
-#include "adb.h"
+#include "sysdeps.h"
-#include <linux/fb.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
+#include "adb.h"
+#include "fdevent.h"
+#include "transport.h"
/* TODO:
** - sync with vsync to avoid tearing
@@ -68,15 +70,15 @@ void framebuffer_service(int fd, void *cookie)
if (pid == 0) {
dup2(fds[1], STDOUT_FILENO);
- close(fds[0]);
- close(fds[1]);
+ adb_close(fds[0]);
+ adb_close(fds[1]);
const char* command = "screencap";
const char *args[2] = {command, NULL};
execvp(command, (char**)args);
exit(1);
}
- close(fds[1]);
+ adb_close(fds[1]);
fd_screencap = fds[0];
/* read w, h & format */
@@ -174,9 +176,9 @@ void framebuffer_service(int fd, void *cookie)
}
done:
- close(fds[0]);
+ adb_close(fds[0]);
TEMP_FAILURE_RETRY(waitpid(pid, NULL, 0));
pipefail:
- close(fd);
+ adb_close(fd);
}