On 05/14/12 12:32 PM, Chase Douglas wrote:
> On 05/10/2012 11:23 PM, Peter Hutterer wrote:
>> On Mon, Apr 16, 2012 at 11:14:22AM -0700, Chase Douglas wrote:
> 
> [snip]
> 
>>>  void
>>> +LogWriteSigSafe(int verb, const char *f, log_param_t *args, int num_args)
>>> +{
>>> +    static char tmpBuffer[1024];
>>> +    int len = 0;
>>> +    char number[20];
>>> +    static Bool newline = TRUE;
>>> +
>>> +    if (newline) {
>>> +        CARD32 ms = GetTimeInMillis();
>>
>> GetTimeInMillis calls gettimeofday() which isn't signal-safe, afaict.
> 
> Thanks for catching that. We could switch to clock_gettime(), but I'm
> not sure what differences, if any, there would be between it and
> gettimeofday(). For now, I've removed the timestamp printing. Someone
> else can come along and add the timestamp back in if they want.

GetTimeInMillis already calls clock_gettime on platforms that support
CLOCK_MONOTONIC* at an appropriate resolution, falling back to gettimeofday()
on others:

http://cgit.freedesktop.org/xorg/xserver/tree/os/utils.c#n409


-- 
        -Alan Coopersmith-              [email protected]
         Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to