The fatal macro was never implemented. Its only user, libkmod-index,
should propagate error condition through errno as good as possible.
Other logging mechanisms are not available without adjusting API
because context is missing.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/123
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
return 0;
}
-static void read_error(void)
-{
- fatal("Module index: unexpected error: %s\n"
- "Try re-running depmod\n", errno ? strerror(errno) : "EOF");
-}
-
static int read_char(FILE *in)
{
int ch;
errno = 0;
ch = getc_unlocked(in);
if (ch == EOF)
- read_error();
+ errno = EINVAL;
return ch;
}
errno = 0;
if (fread(&val, sizeof(uint32_t), 1, in) != 1) {
- read_error();
+ errno = EINVAL;
return -1;
}
*l = ntohl(val);
/* Temporaries for importing index handling */
#define NOFAIL(x) (x)
-#define fatal(x...) do { } while (0)
/* Attributes */