~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/errmsg_stderr/errmsg_stderr.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
public:
37
37
  Error_message_stderr()
38
38
   : plugin::ErrorMessage("Error_message_stderr") {}
39
 
  virtual bool errmsg(Session *, int , const char *format, va_list ap)
 
39
  virtual bool errmsg(error::level_t , const char *format, va_list ap)
40
40
  {
41
41
    char msgbuf[MAX_MSG_LEN];
42
42
    int prv, wrv;
47
47
    /* a single write has a OS level thread lock
48
48
       so there is no need to have mutexes guarding this write,
49
49
    */
50
 
    wrv= write(2, msgbuf, prv);
51
 
    if ((wrv < 0) || (wrv != prv)) return true;
 
50
    wrv= write(fileno(stderr), msgbuf, prv);
 
51
    fputc('\n', stderr);
 
52
    if ((wrv < 0) || (wrv != prv))
 
53
      return true;
52
54
 
53
55
    return false;
54
56
  }
72
74
  N_("Error Messages to stderr"),
73
75
  PLUGIN_LICENSE_GPL,
74
76
  errmsg_stderr_plugin_init,
75
 
  NULL, /* system variables */
 
77
  NULL, /* depends */
76
78
  NULL
77
79
}
78
80
DRIZZLE_DECLARE_PLUGIN_END;