Skip to content

Instantly share code, notes, and snippets.

@DanielG
Created February 4, 2011 14:41
Show Gist options
  • Select an option

  • Save DanielG/811182 to your computer and use it in GitHub Desktop.

Select an option

Save DanielG/811182 to your computer and use it in GitHub Desktop.
struct socklist
{
struct socket_t sl_socket;
struct socklist* sl_next;
};
static int sl_add(socklist** list, socket_t socket)
{
struct socklist* sl = (socklist*) malloc(sizeof(socklist));
if(sl == NULL) {
return -1;
}
sl->sl_socket = socket;
sl->sl_next = list
*list = sl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment