~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/errmsg_print.cc

Merge in additional test case fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
   errmsg_printf()
23
23
*/
24
24
 
25
 
#include <config.h>
 
25
#include "config.h"
26
26
 
27
27
#include <drizzled/definitions.h>
28
28
#include <drizzled/errmsg_print.h>
36
36
 
37
37
void sql_perror(const char *message)
38
38
{
39
 
  char *errmsg_ptr;
40
39
  char errmsg[STRERROR_MAX];
41
40
  errmsg[0]= 0;
42
 
 
43
 
#ifdef STRERROR_R_CHAR_P
44
 
  errmsg_ptr= strerror_r(errno, errmsg, sizeof(errmsg));
45
 
#else
46
41
  strerror_r(errno, errmsg, sizeof(errmsg));
47
 
  errmsg_ptr= errmsg;
48
 
#endif
49
 
 
50
42
  errmsg_printf(error::ERROR, "%s: %s\n", message, errmsg);
51
 
 
52
43
}
53
44
 
54
45
// @todo Cap the size of message.
61
52
// @todo Cap the size of message/extra.
62
53
void sql_perror(std::string message, const std::string &extra)
63
54
{
64
 
  char *errmsg_ptr;
65
55
  char errmsg[STRERROR_MAX];
66
56
  errmsg[0]= 0;
67
 
 
68
 
#ifdef STRERROR_R_CHAR_P
69
 
  errmsg_ptr= strerror_r(errno, errmsg, sizeof(errmsg));
70
 
#else
71
57
  strerror_r(errno, errmsg, sizeof(errmsg));
72
 
  errmsg_ptr= errmsg;
73
 
#endif
74
58
 
75
59
  if (not extra.empty())
76
60
  {