Eric Bollengier wrote: > Le Saturday 10 January 2009 01:02:10 Dan Langille, vous avez écrit : >> Eric Bollengier wrote: >>> Hello Dan, >>> >>> The "pthread" type is not defined on linux... (i have a pthread_t >>> instead) And on linux, pthread_t is an integer, which seems to different >>> on freebsd. >>> >>> Maybe i can use a void * cast at this place ? > > I have take a look to freebsd7 man pages, and they use pthread_t object too.
What cast do you want me to try? The following compiles cleanly: - jcr->use_count(), (int)jcr->my_thread_id); + jcr->use_count(), (pthread *)jcr->my_thread_id); > >> or an #ifdef based on the OS? > > At this place, i would like to display the same thing than in gdb backtrace. I suspect pthread_t on Linux differs from pthread_t on FreeBSD. > > Bye > >>> Bye >>> >>> Le Friday 09 January 2009 19:42:18 Dan Langille, vous avez écrit : >>>> Hi, >>>> >>>> In FreeBSD 7.x, we have a newer gcc, which is being extra picky about >>>> precision when casting. >>>> One of the FreeBSD porters has done some work in this area. His >>>> patches are here (and I have >>>> pasted them to the end of this message): >>>> >>>> http://www.atarininja.org/patches/bacula-server-devel.diff >>>> >>>> NOTE: Ignore the first two three patches (they apply only to the >>>> FreeBSD ports skelton, and not >>>> to Bacula code). >>>> >>>> I will apply these patches to my local working copy and run the >>>> regression tests on them. If all >>>> goes well, I will commit them this weekend. >>>> >>>> >>>> diff -N files/patch-src-cats-sql.c >>>> --- /dev/null 1 Jan 1970 00:00:00 -0000 >>>> +++ files/patch-src-cats-sql.c 9 Jan 2009 17:03:48 -0000 >>>> @@ -0,0 +1,11 @@ >>>> +--- src/cats/sql.c.orig 2009-01-09 12:01:38.100486989 -0500 >>>> ++++ src/cats/sql.c 2009-01-09 12:02:01.559498120 -0500 >>>> +@@ -759,7 +759,7 @@ >>>> + if (mdb->lock.valid == RWLOCK_VALID) { >>>> + fprintf(fp, "\tRWLOCK=%p w_active=%i w_wait=%i\n", &mdb->lock, >>>> mdb->lock.w_active, mdb->lock.w_wait); >>>> + #ifndef HAVE_WIN32 >>>> +- fprintf(fp, "\t\tthreadid=0x%x mutex=%p\n", (int)mdb- >>>> >>>> >lock.writer_id, &mdb->lock.mutex); >>>> >>>> ++ fprintf(fp, "\t\tthreadid=0x%x mutex=%p\n", (pthread *)mdb- >>>> >>>> >lock.writer_id, &mdb->lock.mutex); >>>> >>>> + #endif >>>> + } >>>> + } >>>> Index: files/patch-src-lib-jcr.c >>>> =================================================================== >>>> RCS file: files/patch-src-lib-jcr.c >>>> diff -N files/patch-src-lib-jcr.c >>>> --- /dev/null 1 Jan 1970 00:00:00 -0000 >>>> +++ files/patch-src-lib-jcr.c 9 Jan 2009 16:46:17 -0000 >>>> @@ -0,0 +1,11 @@ >>>> +--- src/lib/jcr.c.orig 2009-01-09 11:31:00.223575817 -0500 >>>> ++++ src/lib/jcr.c 2009-01-09 11:31:31.054591212 -0500 >>>> +@@ -1064,7 +1064,7 @@ >>>> + jcr->use_count()); >>>> + #else >>>> + fprintf(fp, "\tuse_count=%i threadid=0x%x\n", >>>> +- jcr->use_count(), (int)jcr->my_thread_id); >>>> ++ jcr->use_count(), (pthread *)jcr->my_thread_id); >>>> + #endif >>>> + fprintf(fp, "\tJobType=%c JobLevel=%c\n", >>>> + jcr->get_JobType(), jcr->get_JobLevel()); >>> ------------------------------------------------------------------------- ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
