diff options
author | Mark Salyzyn <salyzyn@google.com> | 2015-01-26 10:46:44 -0800 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2015-02-25 17:44:18 +0000 |
commit | 2d3f38a6b8e724749b59d201a01b35fa0951141e (patch) | |
tree | 99855d3dd759307ced68e36ad7206747e55bf51d /logcat | |
parent | 72bf2a710089b5fff42059d5946fe7bdd6b12480 (diff) | |
download | system_core-2d3f38a6b8e724749b59d201a01b35fa0951141e.zip system_core-2d3f38a6b8e724749b59d201a01b35fa0951141e.tar.gz system_core-2d3f38a6b8e724749b59d201a01b35fa0951141e.tar.bz2 |
liblog: introduce ANDROID_LOG_* flags
Move away from using POSIX open(2) flags and introduce ANDROID_LOG_* flags to
replace them. Add security by preventing random mode flags from getting into
underlying POSIX calls. ANDROID_LOG_* flags overlap POSIX O_* flag definitions.
Change-Id: Ib32bb64c287e8bf150be62242e1ba46bb37839fc
Diffstat (limited to 'logcat')
-rw-r--r-- | logcat/logcat.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp index 79f2ebd..829a0af 100644 --- a/logcat/logcat.cpp +++ b/logcat/logcat.cpp @@ -324,7 +324,7 @@ int main(int argc, char **argv) int getPruneList = 0; char *setPruneList = NULL; int printStatistics = 0; - int mode = O_RDONLY; + int mode = ANDROID_LOG_RDONLY; const char *forceFilters = NULL; log_device_t* devices = NULL; log_device_t* dev; @@ -359,15 +359,15 @@ int main(int argc, char **argv) case 'c': clearLog = 1; - mode = O_WRONLY; + mode |= ANDROID_LOG_WRONLY; break; case 'd': - mode = O_RDONLY | O_NDELAY; + mode |= ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK; break; case 't': - mode = O_RDONLY | O_NDELAY; + mode |= ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK; /* FALLTHRU */ case 'T': if (strspn(optarg, "0123456789") != strlen(optarg)) { |