Fix directory validation after handler
[MonkeyD.git] / src / worker.c
blob34f15bdd0abb4477cb0e15356a2ac53c826002bd
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
3 /* Monkey HTTP Daemon
4 * ------------------
5 * Copyright (C) 2001-2008, Eduardo Silva P.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * Youu should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include <pthread.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <unistd.h>
27 pthread_t mk_worker_spawn(void (*func)(void *))
29 pthread_t tid;
30 pthread_attr_t thread_attr;
32 pthread_attr_init(&thread_attr);
33 pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
34 if(pthread_create(&tid, &thread_attr, (void *) func, NULL)<0)
36 perror("pthread_create");
37 exit(1);
40 return tid;