Displaying 1 result from an estimated 1 matches for "destroy_msg".
Did you mean:
destroy_cfg
2006 Sep 06
7
[RFC PATCH] allow connecting to xenconsole from remote hosts
...fd)
-{
- int ret;
+static struct message *alloc_msg(char* data, size_t len)
+{
+ struct message *msg;
+
+ msg = malloc(sizeof(*msg));
+ if (!msg)
+ return NULL;
+
+ memset(msg, 0, sizeof(*msg));
+
+ msg->next = NULL;
+ msg->data = data;
+ msg->len = len;
+
+ return msg;
+}
+
+static void destroy_msg(struct message *msg)
+{
+ msg->len = -1;
+ free(msg->data);
+ msg->data = (char*)0xBADF00D1;
+ free(msg);
+}
+
+static void __queue_msg(struct queue *q, struct message *msg)
+{
+ if (q->tail)
+ q->tail->next = msg;
+ else
+ q->head = q->tail = msg;
+}
+
+static int queue_m...