[Patch] MacOS X support

View: New views
4 Messages — Rating Filter:   Alert me  

[Patch] MacOS X support

by takeoffhoser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First of all, thanks for making libtai available! I've attached a  
patch that makes libtai compile without warning on MacOS 10.4. Most  
of it is cosmetic, but the additional include files are required for  
leapsecs_read.c because the implicit declaration of read() has it  
returning an int when in fact it returns ssize_t (a long int). This  
causes libtai to believe the read() returned 0 (because it is only  
examining the upper 4 bytes of the returned number). libtai then  
reports itself unable to read the leap seconds file and dies.

        Cheers,
        David


Re: [Patch] MacOS X support

by takeoffhoser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I've attached the patch this time.

        David



> First of all, thanks for making libtai available! I've attached a  
> patch that makes libtai compile without warning on MacOS 10.4. Most  
> of it is cosmetic, but the additional include files are required  
> for leapsecs_read.c because the implicit declaration of read() has  
> it returning an int when in fact it returns ssize_t (a long int).  
> This causes libtai to believe the read() returned 0 (because it is  
> only examining the upper 4 bytes of the returned number). libtai  
> then reports itself unable to read the leap seconds file and dies.
>
> Cheers,
> David
>


macos-libtai.patch (2K) Download Attachment

Re: [Patch] MacOS X support

by Jose Celestino :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Words by takeoffhoser@... [Fri, Feb 03, 2006 at 01:45:22PM -0800]:
> Sorry, I've attached the patch this time.
>

Is it me or you got the patch wrong? (diff a <-> b).

> David

> [-- mutt.octet.filter file type: "'diff' output text" --]
>
> diff -r -C5 mlibtai-0.60/check.c libtai-0.60/check.c
> *** mlibtai-0.60/check.c Fri Feb  3 01:23:03 2006
> --- libtai-0.60/check.c Tue Oct 13 09:52:20 1998
> ***************
> *** 1,7 ****
>   #include <stdio.h>
> - #include <stdlib.h>
>   #include <time.h>
>   #include "tai.h"
>   #include "leapsecs.h"
...


--
Jose Celestino | http://xpto.org/~japc/files/japc-pgpkey.asc
----------------------------------------------------------------
"You just have to accept that some days you are the pigeon,
and some days you are the statue." - David Brent

Re: [Patch] MacOS X support

by takeoffhoser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Is it me or you got the patch wrong? (diff a <-> b).
Argh. Yes, you are correct. I'm just not having a good day today.  
I've attached a patch that goes in the right direction (or you can  
just use "-R" on the original.

        David



macos-libtai-2.patch (2K) Download Attachment