#include "log.h"
#include "osl.h"
#include "error.h"
-#include "fd.h"
-#include "list.h"
+#include "util.h"
#include "osl_core.h"
/* Taken from Drepper: How to write shared libraries, Appendix B. */
#define MSGSTRFIELD1(line) str##line
static const union msgstr_t {
struct {
-#define _S(n, s) char MSGSTRFIELD(__LINE__)[sizeof(s)];
+#define OSL_ERROR(n, s) char MSGSTRFIELD(__LINE__)[sizeof(s)];
#include "errtab.h"
-#undef _S
+#undef OSL_ERROR
};
char str[0];
} msgstr = { {
-#define _S(n, s) s,
+#define OSL_ERROR(n, s) s,
#include "errtab.h"
-#undef _S
+#undef OSL_ERROR
} };
static const unsigned int errmsgidx[] = {
-#define _S(n, s) [n] = offsetof(union msgstr_t, MSGSTRFIELD(__LINE__)),
+#define OSL_ERROR(n, s) [n] = offsetof(union msgstr_t, MSGSTRFIELD(__LINE__)),
#include "errtab.h"
-#undef _S
+#undef OSL_ERROR
};
__export const char *osl_strerror(int num)
{
struct stat statbuf;
char *filename = column_filename(t, col_num);
- int ret = -E_OSL_STAT;
+ int ret;
if (!filename)
return -ERRNO_TO_ERROR(ENOMEM);
- if (stat(filename, &statbuf) < 0) {
+ ret = osl_stat(filename, &statbuf);
+ if (ret < 0) {
free(filename);
return ret;
}