Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lafenghu
atftp
atftp-0.7_thread_crash.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File atftp-0.7_thread_crash.patch of Package atftp
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=271816 Index: tftpd.c =================================================================== --- tftpd.c.orig +++ tftpd.c @@ -157,6 +157,7 @@ int main(int argc, char **argv) struct servent *serv; struct passwd *user; struct group *group; + pthread_t tid; #ifdef HAVE_MTFTP pthread_t mtftp_thread; @@ -466,7 +467,7 @@ int main(int argc, char **argv) new->client_info->next = NULL; /* Start a new server thread. */ - if (pthread_create(&new->tid, NULL, tftpd_receive_request, + if (pthread_create(&tid, NULL, tftpd_receive_request, (void *)new) != 0) { logger(LOG_ERR, "Failed to start new thread"); @@ -567,7 +568,8 @@ void *tftpd_receive_request(void *arg) /* Detach ourself. That way the main thread does not have to * wait for us with pthread_join. */ - pthread_detach(pthread_self()); + data->tid = pthread_self(); + pthread_detach(data->tid); /* Read the first packet from stdin. */ data_size = data->data_buffer_size; @@ -733,7 +735,7 @@ void *tftpd_receive_request(void *arg) /* free the thread structure */ free(data); - + logger(LOG_INFO, "Server thread exiting"); pthread_exit(NULL); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor