~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/errmsg_stderr/errmsg_stderr.cc

  • Committer: Mark Atwood
  • Date: 2008-10-16 16:14:57 UTC
  • mto: (520.1.13 drizzle)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: mark@fallenpegasus.com-20081016161457-bbdct0n0ti6hqffk
some bugs in errmsg plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#include <stdarg.h>  /* for va_list */
10
10
#include <unistd.h>  /* for write(2) */
11
11
 
12
 
bool errmsg_stderr_func (THD *thd, int priority, const char *format, va_list ap)
 
12
#define MAX_MSG_LEN 8192
 
13
 
 
14
bool errmsg_stderr_func (THD *thd __attribute__((unused)),
 
15
                         int priority __attribute__((unused)),
 
16
                         const char *format, va_list ap)
13
17
{
14
18
  char msgbuf[MAX_MSG_LEN];
15
19
  int prv, wrv;
16
20
 
17
 
  if (priority > 0)
18
 
    prv = vsnprintf(msgbuf, MAX_MSG_LEN, format, ap);
 
21
  prv= vsnprintf(msgbuf, MAX_MSG_LEN, format, ap);
19
22
  if (prv < 0) return true;
20
23
 
21
24
  /* a single write has a OS level thread lock