summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/keystore/keystore_get.h2
-rw-r--r--libs/binder/IPCThreadState.cpp9
-rw-r--r--libs/ui/EventHub.cpp23
-rw-r--r--libs/utils/ZipUtils.cpp3
4 files changed, 16 insertions, 21 deletions
diff --git a/cmds/keystore/keystore_get.h b/cmds/keystore/keystore_get.h
index a7fd9a556a..7665e81a31 100644
--- a/cmds/keystore/keystore_get.h
+++ b/cmds/keystore/keystore_get.h
@@ -29,7 +29,7 @@
* is returned. Otherwise it returns the value in dynamically allocated memory
* and sets the size if the pointer is not NULL. One can release the memory by
* calling free(). */
-static char *keystore_get(char *key, int *size)
+static char *keystore_get(const char *key, int *size)
{
char buffer[MAX_KEY_VALUE_LENGTH];
char *value;
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index c3889e9855..c371a23b85 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -366,13 +366,8 @@ void IPCThreadState::restoreCallingIdentity(int64_t token)
void IPCThreadState::clearCaller()
{
- if (mProcess->supportsProcesses()) {
- mCallingPid = getpid();
- mCallingUid = getuid();
- } else {
- mCallingPid = -1;
- mCallingUid = -1;
- }
+ mCallingPid = getpid();
+ mCallingUid = getuid();
}
void IPCThreadState::flushCommands()
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp
index 402bce2b06..59c9476287 100644
--- a/libs/ui/EventHub.cpp
+++ b/libs/ui/EventHub.cpp
@@ -509,28 +509,29 @@ int EventHub::open_device(const char *deviceName)
//fprintf(stderr, "could not get device name for %s, %s\n", deviceName, strerror(errno));
name[0] = '\0';
}
- if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
- //fprintf(stderr, "could not get location for %s, %s\n", deviceName, strerror(errno));
- location[0] = '\0';
- }
- if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
- //fprintf(stderr, "could not get idstring for %s, %s\n", deviceName, strerror(errno));
- idstr[0] = '\0';
- }
// check to see if the device is on our excluded list
List<String8>::iterator iter = mExcludedDevices.begin();
List<String8>::iterator end = mExcludedDevices.end();
for ( ; iter != end; iter++) {
- const char* name = *iter;
- if (strcmp(name, idstr) == 0) {
- LOGD("ignoring event id %s driver %s\n", deviceName, name);
+ const char* test = *iter;
+ if (strcmp(name, test) == 0) {
+ LOGI("ignoring event id %s driver %s\n", deviceName, test);
close(fd);
fd = -1;
return -1;
}
}
+ if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
+ //fprintf(stderr, "could not get location for %s, %s\n", deviceName, strerror(errno));
+ location[0] = '\0';
+ }
+ if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
+ //fprintf(stderr, "could not get idstring for %s, %s\n", deviceName, strerror(errno));
+ idstr[0] = '\0';
+ }
+
int devid = 0;
while (devid < mNumDevicesById) {
if (mDevicesById[devid].device == NULL) {
diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp
index 5df94cbbd9..9138878ff7 100644
--- a/libs/utils/ZipUtils.cpp
+++ b/libs/utils/ZipUtils.cpp
@@ -210,7 +210,7 @@ bail:
LOGV("+++ reading %ld bytes (%ld left)\n",
getSize, compRemaining);
- int cc = fread(readBuf, getSize, 1, fp);
+ int cc = fread(readBuf, 1, getSize, fp);
if (cc != (int) getSize) {
LOGD("inflate read failed (%d vs %ld)\n",
cc, getSize);
@@ -341,4 +341,3 @@ bail:
return true;
}
-