diff options
Diffstat (limited to 'src/client_list.c')
-rw-r--r-- | src/client_list.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/client_list.c b/src/client_list.c index 8379dd9..55e0044 100644 --- a/src/client_list.c +++ b/src/client_list.c @@ -1,32 +1,33 @@ /* - * rhdropbox + * dropnroll * - * Copyright (C) 2009 Christian Pointner <equinox@helsinki.at> + * Copyright (C) 2009-2015 Christian Pointner <equinox@spreadspace.org> * - * This file is part of rhdropbox. + * This file is part of dropnroll. * - * rhdropbox is free software: you can redistribute it and/or modify + * dropnroll is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * - * rhdropbox is distributed in the hope that it will be useful, + * dropnroll is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with rhdropbox. If not, see <http://www.gnu.org/licenses/>. + * along with dropnroll. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> +#include <unistd.h> #include "client_list.h" #include "datatypes.h" client_t* client_get_last(client_t* first) { - if(!first) + if(!first) return NULL; while(first->next) { @@ -55,7 +56,7 @@ int client_add(client_t** first, int fd) *first = new_client; return 0; } - + client_get_last(*first)->next = new_client; return 0; @@ -63,7 +64,7 @@ int client_add(client_t** first, int fd) void client_remove(client_t** first, int fd) { - if(!first || !(*first)) + if(!first || !(*first)) return; client_t* deletee = *first; @@ -92,7 +93,7 @@ client_t* client_find(client_t* first, int fd) { if(!first) return NULL; - + while(first) { if(first->fd == fd) return first; @@ -104,7 +105,7 @@ client_t* client_find(client_t* first, int fd) void client_clear(client_t** first) { - if(!first || !(*first)) + if(!first || !(*first)) return; while(*first) { |