• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

修订版a61755e5fca065dfc89c7639bb672c20a4f9854e (tree)
时间2009-05-21 08:21:29
作者Android (Google) Code Review <android-gerrit@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge change 2077 into donut

* changes:

adb: adbd no longer disables OOM and now sets children's OOM adjustment to zero

更改概述

差异

--- a/adb/adb.c
+++ b/adb/adb.c
@@ -818,19 +818,6 @@ int adb_main(int is_daemon)
818818 #if !ADB_HOST
819819 int secure = 0;
820820 char value[PROPERTY_VALUE_MAX];
821-
822- // prevent the OOM killer from killing us
823- char text[64];
824- snprintf(text, sizeof text, "/proc/%d/oom_adj", (int)getpid());
825- int fd = adb_open(text, O_WRONLY);
826- if (fd >= 0) {
827- // -17 should make us immune to OOM
828- snprintf(text, sizeof text, "%d", -17);
829- adb_write(fd, text, strlen(text));
830- adb_close(fd);
831- } else {
832- D("adb: unable to open %s\n", text);
833- }
834821 #endif
835822
836823 atexit(adb_cleanup);
--- a/adb/services.c
+++ b/adb/services.c
@@ -244,6 +244,18 @@ static int create_subprocess(const char *cmd, const char *arg0, const char *arg1
244244 cmd, strerror(errno), errno);
245245 exit(-1);
246246 } else {
247+#if !ADB_HOST
248+ // set child's OOM adjustment to zero
249+ char text[64];
250+ snprintf(text, sizeof text, "/proc/%d/oom_adj", pid);
251+ int fd = adb_open(text, O_WRONLY);
252+ if (fd >= 0) {
253+ adb_write(fd, "0", 1);
254+ adb_close(fd);
255+ } else {
256+ D("adb: unable to open %s\n", text);
257+ }
258+#endif
247259 return ptm;
248260 }
249261 #endif /* !HAVE_WIN32_PROC */