From a7f577ba24f314d3916cbff9a83fb33ee2d3b202 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 7 Jul 2008 18:16:05 +0000 Subject: - monitor-get-edid-using-vbe: o instead of checking vt >= 7 to know if X is running, check wether $DISPLAY is set --- monitor-get-edid-using-vbe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'monitor-get-edid-using-vbe.c') diff --git a/monitor-get-edid-using-vbe.c b/monitor-get-edid-using-vbe.c index 79fb0c3..753b46e 100644 --- a/monitor-get-edid-using-vbe.c +++ b/monitor-get-edid-using-vbe.c @@ -49,12 +49,12 @@ int main(int argc, char **argv) if (!size && try_in_console) { int non_X_console = 1; - int first_X_console = 7; struct vt_stat current; int fd = open("/dev/console", O_RDWR); - if (ioctl(fd, VT_GETSTATE, ¤t) == 0 && - current.v_active >= first_X_console && + if (getenv("DISPLAY") != NULL && + ioctl(fd, VT_GETSTATE, ¤t) == 0 && + current.v_active != non_X_console && ioctl(fd, VT_ACTIVATE, non_X_console) == 0 && ioctl(fd, VT_WAITACTIVE, non_X_console) == 0) { /* retrying */ -- cgit v1.2.1