[PATCH v2 00/14] Fix signal-unsafe logging

Chase Douglas chase.douglas at canonical.com
Fri Apr 13 09:34:53 PDT 2012


On 04/13/2012 02:22 AM, Michal Suchanek wrote:
> On 13 April 2012 03:09, Peter Hutterer <peter.hutterer at who-t.net> wrote:
>>  typedef union {
>>      uint32_t ui;
>>      int32_t i;
>>      char *c;
>>      const char *str;
>>      void *ptr;
>>  } log_param_t;
>>
>>  /* Log a message using only signal safe functions. */
>>  void
>>  LogMessageVerbSigSafe(MessageType type, int verb, const char *message,
>>                        log_param_t* param)
> ...
>> Instead of varargs, the callers need to supply a log_param_t array, which is
>> painful, but hopefully better than splitting log messages over several commands.
>>
> I don't think you can initialize an array of log_param_t sanely in
> standard C. Unless you are going to have gcc as hard dependency this
> is probably going to be more painful than just using multiple
> statements.

I think we're well beyond "sane" approaches :). I do have something
cooking, though, that will hide everything behind variadic macros!

-- Chase


More information about the xorg-devel mailing list