Skip to content

Commit

Permalink
Match prototypes of callbacks with libgphoto
Browse files Browse the repository at this point in the history
In ccc4c1f
we tried to fix by using pthread_t but it also needs to make changes in
libgphoto and these changes can be invasive, therefore lets revert to
older types and to fix musl problem fix it via type casts

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Mar 2, 2023
1 parent 7635be2 commit 366930c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gphoto2/main.c
Expand Up @@ -1198,7 +1198,7 @@ thread_func (void *data)
pthread_cleanup_pop (1);
}

static pthread_t
static unsigned int
start_timeout_func (Camera *camera, unsigned int timeout,
CameraTimeoutFunc func, void __unused__ *data)
{
Expand All @@ -1215,14 +1215,14 @@ start_timeout_func (Camera *camera, unsigned int timeout,

pthread_create (&tid, NULL, thread_func, td);

return (tid);
return (unsigned int)tid;
}

static void
stop_timeout_func (Camera __unused__ *camera, pthread_t id,
stop_timeout_func (Camera __unused__ *camera, unsigned int id,
void __unused__ *data)
{
pthread_t tid = id;
pthread_t tid = (pthread_t)id;

pthread_cancel (tid);
pthread_join (tid, NULL);
Expand Down

0 comments on commit 366930c

Please sign in to comment.