X-Git-Url: https://git.deb.at/w?p=pkg%2Fbeep.git;a=blobdiff_plain;f=beep.c;h=f80eb7648c9b6fee6c2d76b59635b49a2f541310;hp=f774b56247d9fba66f9cfdff011708a985dee727;hb=0b72fe17e679c0b3c88448cc2fc6830d3db20f93;hpb=05e67326bf208399329240c1c5ab5513d15b0505 diff --git a/beep.c b/beep.c index f774b56..f80eb76 100644 --- a/beep.c +++ b/beep.c @@ -218,11 +218,13 @@ void play_beep(beep_parms_t parms) { int i; /* loop counter */ /* try to snag the console */ - if((console_fd = open("/dev/console", O_WRONLY)) == -1) { - fprintf(stderr, "Could not open /dev/console 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/tty0", O_WRONLY)) == -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 */