Augment the chances LogOutOfMem() works in out-of-memory conditions.
All instances are called with only one constant string so no need for varargs dance.
This commit is contained in:
parent
d3274fece8
commit
7161f1690d
@ -39,7 +39,7 @@ extern void InitErrorLog (void);
|
||||
extern void LogAppend (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
|
||||
extern void LogError (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
|
||||
extern void LogInfo (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
|
||||
extern void LogOutOfMem (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
|
||||
extern void LogOutOfMem (const char * function);
|
||||
extern __dead void LogPanic (const char * fmt, ...) _X_ATTRIBUTE_PRINTF(1,2);
|
||||
|
||||
|
||||
|
@ -98,15 +98,11 @@ LogPanic (const char * fmt, ...)
|
||||
}
|
||||
|
||||
void
|
||||
LogOutOfMem (const char * fmt, ...)
|
||||
LogOutOfMem (const char *function)
|
||||
{
|
||||
fprintf (stderr, "xdm: out of memory in routine ");
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vfprintf (stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
fputs("xdm: out of memory in routine ", stderr);
|
||||
fputs(function, stderr);
|
||||
fputc('\n', stderr);
|
||||
fflush (stderr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user