~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/errmsg.cc

  • Committer: Monty
  • Date: 2008-11-23 10:24:32 UTC
  • mfrom: (602.1.1 drizzle-errmsg)
  • mto: This revision was merged to the branch mainline in revision 603.
  • Revision ID: mordred@palanthas.inaugust.com-20081123102432-oemtkoorm9t85sbx
MergedĀ fromĀ Mark.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <drizzled/errmsg.h>
22
22
#include <drizzled/gettext.h>
23
23
 
 
24
static bool errmsg_has= false;
 
25
 
24
26
int errmsg_initializer(st_plugin_int *plugin)
25
27
{
26
28
  errmsg_t *p;
46
48
      goto err;
47
49
    }
48
50
  }
 
51
 
 
52
  errmsg_has= true;
 
53
 
49
54
  return 0;
50
55
 
51
56
err:
121
126
  bool foreach_rv;
122
127
  errmsg_parms_t parms;
123
128
 
 
129
  /* check to see if any errmsg plugin has been loaded
 
130
     if not, just fall back to emitting the message to stderr */
 
131
  if (!errmsg_has)
 
132
  {
 
133
    /* if it turns out that the vfprintf doesnt do one single write
 
134
       (single writes are atomic), then this needs to be rewritten to
 
135
       vsprintf into a char buffer, and then write() that char buffer
 
136
       to stderr */
 
137
    vfprintf(stderr, format, ap);
 
138
    return false;
 
139
  }
 
140
 
124
141
  /* marshall the parameters so they will fit into the foreach */
125
142
  parms.priority= priority;
126
143
  parms.format= format;