util: u_queue: fix android build error
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 5 Jul 2018 10:55:43 +0000 (11:55 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 5 Jul 2018 14:42:26 +0000 (15:42 +0100)
mesa/src/util/u_queue.c:242:15: error: address of array 'queue->name'
  will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

Fixes: b238e33bc9d48b814370 "kutil/queue: add a process name into a thread name"
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/util/u_queue.c

index 8a43320e59f17e32c76cf513c8952e2a5a40e827..be95d9eec3f623ac2531628e60c1e01e9305d46d 100644 (file)
@@ -239,7 +239,7 @@ util_queue_thread_func(void *input)
 
    free(input);
 
-   if (queue->name) {
+   if (strlen(queue->name) > 0) {
       char name[16];
       util_snprintf(name, sizeof(name), "%s%i", queue->name, thread_index);
       u_thread_setname(name);