diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-12-15 02:21:32 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-12-15 02:21:32 -0500 |
commit | 7cf822201abf30c1603334e0b7e664050e2e38a2 (patch) | |
tree | c150f5d6991b09b1df57e2040367160aa4a56ef5 /nslcd/hackers.c | |
parent | a299f2039f68b311e1b75b22fad63a8ddee9e286 (diff) |
it builds!
Diffstat (limited to 'nslcd/hackers.c')
-rw-r--r-- | nslcd/hackers.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nslcd/hackers.c b/nslcd/hackers.c new file mode 100644 index 0000000..57d4f97 --- /dev/null +++ b/nslcd/hackers.c @@ -0,0 +1,42 @@ +#include <stdbool.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> +#include <pthread.h> +#include "hackers_watch.h" +#include "log.h" + +void *hackers_session_worker(void *sess) { + hackers_worker(sess); + return NULL; +} + +struct session *hackers_session_create(pthread_t *thread) { + struct session *session = malloc(sizeof(struct session)); + if (session == NULL) { + log_log(LOG_CRIT, "hackers_session_create(): malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + if (pthread_create(thread, NULL, hackers_session_worker, (void*)session)) { + log_log(LOG_ERR, "unable to start hackers worker thread: %s", + strerror(errno)); + exit(EXIT_FAILURE); + } + return session; +} + +void hackers_session_check(struct session *sess) { + /* do nothing */ +} + +void hackers_session_close(struct session *sess) { + /* do nothing */ +} + +void hackers_session_messup(struct session *sess) { + pthread_rwlock_rdlock(&(sess->lock)); +} + +void hackers_session_cleanup(struct session *sess) { + pthread_rwlock_unlock(&(sess->lock)); +} |