From: Johnathan Nightingale Date: Tue, 13 Jul 2010 23:54:16 +0000 (-0400) Subject: Gerfried's devfs fix X-Git-Tag: upstream/1.3~1^2~2 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=32e5dd183f74c8262f9a893a2a0956e6bf40d856;p=pkg%2Fbeep.git Gerfried's devfs fix --- diff --git a/beep.c b/beep.c index 90ec837..a3a0131 100644 --- a/beep.c +++ b/beep.c @@ -239,10 +239,12 @@ void play_beep(beep_parms_t parms) { /* try to snag the console */ if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) { - fprintf(stderr, "Could not open /dev/tty0 for writing.\n"); - printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ - perror("open"); - exit(1); + if((console_fd = open("/dev/vc/0", O_WRONLY)) == -1) { + fprintf(stderr, "Could not open /dev/tty0 or /dev/vc/0 for writing.\n"); + printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ + perror("open"); + exit(1); + } } /* Beep */