~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/errmsg_print.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
*/
24
24
 
25
25
#include "config.h"
26
 
#include <drizzled/plugin/registry.h>
 
26
 
 
27
#include <drizzled/definitions.h>
27
28
#include <drizzled/errmsg_print.h>
28
 
#include <drizzled/current_session.h>
29
29
#include <drizzled/plugin/error_message.h>
30
30
 
31
31
#include <cerrno>
36
36
 
37
37
void sql_perror(const char *message)
38
38
{
39
 
  // is stderr threadsafe?
40
 
  errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s", message, strerror(errno));
 
39
  char errmsg[STRERROR_MAX];
 
40
  strerror_r(errno, errmsg, sizeof(errmsg));
 
41
  errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s\n", message, errmsg);
41
42
}
42
43
 
43
44
bool errmsg_printf (int priority, char const *format, ...)
45
46
  bool rv;
46
47
  va_list args;
47
48
  va_start(args, format);
48
 
  rv= plugin::ErrorMessage::vprintf(current_session, priority, format, args);
 
49
  rv= plugin::ErrorMessage::vprintf(NULL, priority, format, args);
49
50
  va_end(args);
50
51
  return rv;
51
52
}