Ejemplo n.º 1
0
/* Writes the last error message to the standard error. */
void PrintError(const char* message) {
  char buffer[256];

  if (NaClGetLastErrorString(buffer, sizeof buffer) == 0) {
    fprintf(stderr, "%s: %s", message, buffer);
  }
}
Ejemplo n.º 2
0
/* Writes the last error message to the standard error. */
static void failWithErrno(const char* message) {
  char buffer[256];

  if (0 == NaClGetLastErrorString(buffer, sizeof(buffer))) {
    fprintf(stderr, "%s: %s", message, buffer);
  }
  exit(EXIT_FAILURE);
}