struct sockaddr_in sin;
int s, i;
- bzero((char *)&sin, sizeof(sin));
+ memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
lprintf(1, "citserver: can't allocate memory!!\n");
pthread_exit(NULL);
}
- bzero(me, sizeof(struct CitContext));
+ memset(me, 0, sizeof(struct CitContext));
begin_critical_section(S_SESSION_TABLE);
me->next = ContextList;
/*
* The system-dependent wrapper around the main context loop.
*/
-void sd_context_loop(struct CitContext *con) {
+void *sd_context_loop(struct CitContext *con) {
pthread_cleanup_push(*cleanup_stuff, NULL);
context_loop(con);
pthread_cleanup_pop(0);
+ return NULL;
}
/* now create the thread */
lprintf(9, "creating thread\n");
- if (pthread_create(&SessThread, &attr, (void *)sd_context_loop,
- con) != 0) {
+ if (pthread_create(&SessThread, &attr,
+ (void* (*)(void*)) sd_context_loop,
+ con)
+ != 0) {
lprintf(1,
"citserver: can't create thread: %s\n",
strerror(errno));