summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-03-22 15:55:09 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2010-03-22 15:55:09 -0700
commit377d4c979dee3dcb5929e8f7a68a53c2407259ab (patch)
tree1783fe0272f1437faabfe8365e615696eb8d374c /libc/bionic
parent709a898de82128c065381e258e8e71f0a55df976 (diff)
parent1825fb5d5f214849e39d95660795a0d3633f8eeb (diff)
downloadbionic-377d4c979dee3dcb5929e8f7a68a53c2407259ab.zip
bionic-377d4c979dee3dcb5929e8f7a68a53c2407259ab.tar.gz
bionic-377d4c979dee3dcb5929e8f7a68a53c2407259ab.tar.bz2
merge from open-source master
Change-Id: I70266ee8c520b216773f267e46c8273d2334c31d
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/malloc_debug_leak.c5
-rw-r--r--libc/bionic/pthread.c9
-rw-r--r--libc/bionic/pututline.c2
-rw-r--r--libc/bionic/ssp.c4
4 files changed, 10 insertions, 10 deletions
diff --git a/libc/bionic/malloc_debug_leak.c b/libc/bionic/malloc_debug_leak.c
index e11606d..2ff8cee 100644
--- a/libc/bionic/malloc_debug_leak.c
+++ b/libc/bionic/malloc_debug_leak.c
@@ -430,8 +430,9 @@ void* chk_realloc(void* mem, size_t bytes)
}
if (new_buffer) {
- size_t size = (bytes < old_bytes)?(bytes):(old_bytes);
- memcpy(new_buffer, mem, size);
+ if (bytes > old_bytes)
+ bytes = old_bytes;
+ memcpy(new_buffer, mem, bytes);
chk_free(mem);
}
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index 3294cea..6a2329f 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -601,13 +601,12 @@ int pthread_join(pthread_t thid, void ** ret_val)
for (thread = gThreadList; thread != NULL; thread = thread->next)
if (thread == (pthread_internal_t*)thid)
- break;
+ goto FoundIt;
- if (!thread) {
- pthread_mutex_unlock(&gThreadListLock);
- return ESRCH;
- }
+ pthread_mutex_unlock(&gThreadListLock);
+ return ESRCH;
+FoundIt:
if (thread->attr.flags & PTHREAD_ATTR_FLAG_DETACHED) {
pthread_mutex_unlock(&gThreadListLock);
return EINVAL;
diff --git a/libc/bionic/pututline.c b/libc/bionic/pututline.c
index 2449068..c8427f7 100644
--- a/libc/bionic/pututline.c
+++ b/libc/bionic/pututline.c
@@ -34,7 +34,7 @@ void pututline(struct utmp* utmp)
{
FILE* f;
struct utmp u;
- int i;
+ long i;
if (!(f = fopen(_PATH_UTMP, "w+")))
return;
diff --git a/libc/bionic/ssp.c b/libc/bionic/ssp.c
index 20794f4..f83b2a4 100644
--- a/libc/bionic/ssp.c
+++ b/libc/bionic/ssp.c
@@ -76,9 +76,9 @@ void __stack_chk_fail(void)
sigprocmask(SIG_BLOCK, &sigmask, NULL);
/* Use /proc/self/exe link to obtain the program name for logging
- * purposes. If it's not available, we set it to "unknown" */
+ * purposes. If it's not available, we set it to "<unknown>" */
if ((count = readlink("/proc/self/exe", path, sizeof(path) - 1)) == -1) {
- strlcpy(path, "unknown", sizeof(path));
+ strlcpy(path, "<unknown>", sizeof(path));
} else {
path[count] = '\0';
}