~prafulla-t/drizzle/drz-fast-timer-and-time-profile-refactoring

« back to all changes in this revision

Viewing changes to plugin/transaction_log/print_transaction_message.cc

  • Committer: Prafulla Tekawade
  • Date: 2010-08-22 06:26:33 UTC
  • mfrom: (1685.40.6 staging)
  • Revision ID: prafulla_t@users.sourceforge.net-20100822062633-rda0zeuhg6nhyyom
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "drizzled/charset.h"
38
38
 
39
39
#include <fcntl.h>
 
40
#include <errno.h>
40
41
 
41
42
#include "transaction_log.h"
42
43
#include "print_transaction_message.h"
99
100
  int log_file= open(filename.c_str(), O_RDONLY);
100
101
  if (log_file == -1)
101
102
  {
 
103
    char errmsg[STRERROR_MAX];
 
104
    strerror_r(errno, errmsg, sizeof(errmsg));
102
105
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to open transaction log file %s.  Got error: %s\n"), 
103
106
                  filename.c_str(), 
104
 
                  strerror(errno));
 
107
                  errmsg);
105
108
    null_value= true;
106
109
    return NULL;
107
110
  }
139
142
  bool result= coded_input->ReadRaw(buffer, message_size);
140
143
  if (result == false)
141
144
  {
 
145
    char errmsg[STRERROR_MAX];
 
146
    strerror_r(errno, errmsg, sizeof(errmsg));
142
147
    fprintf(stderr, _("Could not read transaction message.\n"));
143
 
    fprintf(stderr, _("GPB ERROR: %s.\n"), strerror(errno));
 
148
    fprintf(stderr, _("GPB ERROR: %s.\n"), errmsg);
144
149
    fprintf(stderr, _("Raw buffer read: %s.\n"), buffer);
145
150
  }
146
151