]> git.deb.at Git - pkg/beep.git/commitdiff
Gerfried's devfs fix
authorJohnathan Nightingale <johnath@johnath.com>
Tue, 13 Jul 2010 23:54:16 +0000 (19:54 -0400)
committerJohnathan Nightingale <johnath@johnath.com>
Tue, 13 Jul 2010 23:54:16 +0000 (19:54 -0400)
beep.c

diff --git a/beep.c b/beep.c
index 90ec8370dba1165c7eafc82d4aa3ee483b99911a..a3a01318ed827ce1fd4a9d37bea9426f3f221898 100644 (file)
--- 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 */