diff mbox

[API-NEXT,PATCHv2,2/3] linux-generic: queue: allow for anonymous queues

Message ID 1436874728-5160-2-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer July 14, 2015, 11:52 a.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/odp_queue.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
index 2546e2b..31d76ef 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -52,7 +52,10 @@  queue_entry_t *get_qentry(uint32_t queue_id)
 static void queue_init(queue_entry_t *queue, const char *name,
 		       odp_queue_type_t type, odp_queue_param_t *param)
 {
-	strncpy(queue->s.name, name, ODP_QUEUE_NAME_LEN - 1);
+	if (name)
+		strncpy(queue->s.name, name, ODP_QUEUE_NAME_LEN - 1);
+	else
+		memset(queue->s.name, 0, sizeof(queue->s.name));
 	queue->s.type = type;
 
 	if (param) {