summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2016-10-23 20:35:45 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2016-10-23 20:35:45 +0000
commit8d6f4b8517e4e3b1844e3227b4cde4be423154b3 (patch)
treee0bbed113c5a5ffd52331f2f431a963e61ed5d81 /app
parenta3c9573983e3dd2f290c7c58b485e83ace5d1560 (diff)
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.
Diffstat (limited to 'app')
-rw-r--r--app/xenodm/include/dm_error.h2
-rw-r--r--app/xenodm/xenodm/error.c12
2 files changed, 5 insertions, 9 deletions
diff --git a/app/xenodm/include/dm_error.h b/app/xenodm/include/dm_error.h
index eecc14aa6..20aa00fba 100644
--- a/app/xenodm/include/dm_error.h
+++ b/app/xenodm/include/dm_error.h
@@ -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);
diff --git a/app/xenodm/xenodm/error.c b/app/xenodm/xenodm/error.c
index 59ae069a5..f41d09aab 100644
--- a/app/xenodm/xenodm/error.c
+++ b/app/xenodm/xenodm/error.c
@@ -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);
}