[PATCH v3 05/16] Add LogMessageVerbSigSafe() for logging messages while in signal context

Chase Douglas chase.douglas at canonical.com
Mon May 14 12:32:49 PDT 2012


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.

-- Chase


More information about the xorg-devel mailing list