gpm/gpm-1.20.1-lib-silent.patch
prockai 1e4ad8c47f - do not ooops in gpm when console device cannot be found, print an error
message instead and exit(1), as per BR 140025, 176178
- do not print messages in libgpm, unless envvar GPM_VERBOSE is set --
    avoids unwanted clutter from libgpm in apps like dialog or mc when gpm
    is not available
2006-01-18 12:07:55 +00:00

20 lines
507 B
Diff

--- gpm-1.20.1/src/lib/report-lib.c.lib-silent 2002-12-24 23:57:16.000000000 +0100
+++ gpm-1.20.1/src/lib/report-lib.c 2006-01-18 17:55:38.000000000 +0100
@@ -24,8 +24,16 @@
#include "headers/message.h"
+static int gpm_silent() {
+ if ( getenv( "GPM_VERBOSE" ) == NULL ) return 1;
+ return 0;
+}
+
void gpm_report(int line, char *file, int stat, char *text, ... )
{
+ if ( gpm_silent() && stat != GPM_STAT_OOPS )
+ return;
+
char *string = NULL;
va_list ap;
va_start(ap,text);