diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gpio/gpio-event-mon.c | 2 | ||||
-rw-r--r-- | tools/iio/iio_generic_buffer.c | 4 | ||||
-rw-r--r-- | tools/include/linux/string.h | 6 | ||||
-rw-r--r-- | tools/lguest/lguest.c | 6 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 6 | ||||
-rw-r--r-- | tools/perf/util/unwind-libdw.c | 2 | ||||
-rw-r--r-- | tools/perf/util/unwind-libunwind-local.c | 2 |
7 files changed, 16 insertions, 12 deletions
diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c index 448ed96b3b4f..1c14c2595158 100644 --- a/tools/gpio/gpio-event-mon.c +++ b/tools/gpio/gpio-event-mon.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * gpio-hammer - example swiss army knife to shake GPIO lines on a system | 2 | * gpio-event-mon - monitor GPIO line events from userspace |
3 | * | 3 | * |
4 | * Copyright (C) 2016 Linus Walleij | 4 | * Copyright (C) 2016 Linus Walleij |
5 | * | 5 | * |
diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c index 0e8a1f7a292d..f39c0e9c0d5c 100644 --- a/tools/iio/iio_generic_buffer.c +++ b/tools/iio/iio_generic_buffer.c | |||
@@ -348,7 +348,7 @@ int main(int argc, char **argv) | |||
348 | int notrigger = 0; | 348 | int notrigger = 0; |
349 | char *dummy; | 349 | char *dummy; |
350 | 350 | ||
351 | struct iio_channel_info *channels; | 351 | struct iio_channel_info *channels = NULL; |
352 | 352 | ||
353 | register_cleanup(); | 353 | register_cleanup(); |
354 | 354 | ||
@@ -456,7 +456,7 @@ int main(int argc, char **argv) | |||
456 | 456 | ||
457 | if (notrigger) { | 457 | if (notrigger) { |
458 | printf("trigger-less mode selected\n"); | 458 | printf("trigger-less mode selected\n"); |
459 | } if (trig_num >= 0) { | 459 | } else if (trig_num >= 0) { |
460 | char *trig_dev_name; | 460 | char *trig_dev_name; |
461 | ret = asprintf(&trig_dev_name, "%strigger%d", iio_dir, trig_num); | 461 | ret = asprintf(&trig_dev_name, "%strigger%d", iio_dir, trig_num); |
462 | if (ret < 0) { | 462 | if (ret < 0) { |
diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h index b96879477311..f436d2420a18 100644 --- a/tools/include/linux/string.h +++ b/tools/include/linux/string.h | |||
@@ -8,7 +8,11 @@ void *memdup(const void *src, size_t len); | |||
8 | 8 | ||
9 | int strtobool(const char *s, bool *res); | 9 | int strtobool(const char *s, bool *res); |
10 | 10 | ||
11 | #ifdef __GLIBC__ | 11 | /* |
12 | * glibc based builds needs the extern while uClibc doesn't. | ||
13 | * However uClibc headers also define __GLIBC__ hence the hack below | ||
14 | */ | ||
15 | #if defined(__GLIBC__) && !defined(__UCLIBC__) | ||
12 | extern size_t strlcpy(char *dest, const char *src, size_t size); | 16 | extern size_t strlcpy(char *dest, const char *src, size_t size); |
13 | #endif | 17 | #endif |
14 | 18 | ||
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index d9836c5eb694..11c8d9bc762e 100644 --- a/tools/lguest/lguest.c +++ b/tools/lguest/lguest.c | |||
@@ -3266,6 +3266,9 @@ int main(int argc, char *argv[]) | |||
3266 | } | 3266 | } |
3267 | } | 3267 | } |
3268 | 3268 | ||
3269 | /* If we exit via err(), this kills all the threads, restores tty. */ | ||
3270 | atexit(cleanup_devices); | ||
3271 | |||
3269 | /* We always have a console device, and it's always device 1. */ | 3272 | /* We always have a console device, and it's always device 1. */ |
3270 | setup_console(); | 3273 | setup_console(); |
3271 | 3274 | ||
@@ -3369,9 +3372,6 @@ int main(int argc, char *argv[]) | |||
3369 | /* Ensure that we terminate if a device-servicing child dies. */ | 3372 | /* Ensure that we terminate if a device-servicing child dies. */ |
3370 | signal(SIGCHLD, kill_launcher); | 3373 | signal(SIGCHLD, kill_launcher); |
3371 | 3374 | ||
3372 | /* If we exit via err(), this kills all the threads, restores tty. */ | ||
3373 | atexit(cleanup_devices); | ||
3374 | |||
3375 | /* If requested, chroot to a directory */ | 3375 | /* If requested, chroot to a directory */ |
3376 | if (chroot_path) { | 3376 | if (chroot_path) { |
3377 | if (chroot(chroot_path) != 0) | 3377 | if (chroot(chroot_path) != 0) |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index d9b80ef881cd..21fd573106ed 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -507,17 +507,17 @@ static int __perf_evsel__hw_cache_name(u64 config, char *bf, size_t size) | |||
507 | u8 op, result, type = (config >> 0) & 0xff; | 507 | u8 op, result, type = (config >> 0) & 0xff; |
508 | const char *err = "unknown-ext-hardware-cache-type"; | 508 | const char *err = "unknown-ext-hardware-cache-type"; |
509 | 509 | ||
510 | if (type > PERF_COUNT_HW_CACHE_MAX) | 510 | if (type >= PERF_COUNT_HW_CACHE_MAX) |
511 | goto out_err; | 511 | goto out_err; |
512 | 512 | ||
513 | op = (config >> 8) & 0xff; | 513 | op = (config >> 8) & 0xff; |
514 | err = "unknown-ext-hardware-cache-op"; | 514 | err = "unknown-ext-hardware-cache-op"; |
515 | if (op > PERF_COUNT_HW_CACHE_OP_MAX) | 515 | if (op >= PERF_COUNT_HW_CACHE_OP_MAX) |
516 | goto out_err; | 516 | goto out_err; |
517 | 517 | ||
518 | result = (config >> 16) & 0xff; | 518 | result = (config >> 16) & 0xff; |
519 | err = "unknown-ext-hardware-cache-result"; | 519 | err = "unknown-ext-hardware-cache-result"; |
520 | if (result > PERF_COUNT_HW_CACHE_RESULT_MAX) | 520 | if (result >= PERF_COUNT_HW_CACHE_RESULT_MAX) |
521 | goto out_err; | 521 | goto out_err; |
522 | 522 | ||
523 | err = "invalid-cache"; | 523 | err = "invalid-cache"; |
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index cf5e250bc78e..783a53fb7a4e 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c | |||
@@ -66,7 +66,7 @@ static int entry(u64 ip, struct unwind_info *ui) | |||
66 | if (__report_module(&al, ip, ui)) | 66 | if (__report_module(&al, ip, ui)) |
67 | return -1; | 67 | return -1; |
68 | 68 | ||
69 | e->ip = ip; | 69 | e->ip = al.addr; |
70 | e->map = al.map; | 70 | e->map = al.map; |
71 | e->sym = al.sym; | 71 | e->sym = al.sym; |
72 | 72 | ||
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 97c0f8fc5561..20c2e5743903 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c | |||
@@ -542,7 +542,7 @@ static int entry(u64 ip, struct thread *thread, | |||
542 | thread__find_addr_location(thread, PERF_RECORD_MISC_USER, | 542 | thread__find_addr_location(thread, PERF_RECORD_MISC_USER, |
543 | MAP__FUNCTION, ip, &al); | 543 | MAP__FUNCTION, ip, &al); |
544 | 544 | ||
545 | e.ip = ip; | 545 | e.ip = al.addr; |
546 | e.map = al.map; | 546 | e.map = al.map; |
547 | e.sym = al.sym; | 547 | e.sym = al.sym; |
548 | 548 | ||