]> git.deb.at Git - pkg/beep.git/blobdiff - beep.c
Gerfried's devfs fix
[pkg/beep.git] / beep.c
diff --git a/beep.c b/beep.c
index 80fc1ed676eb96c9d5b1ae4f5eb56baf4078ef7d..a3a01318ed827ce1fd4a9d37bea9426f3f221898 100644 (file)
--- a/beep.c
+++ b/beep.c
@@ -238,11 +238,13 @@ void play_beep(beep_parms_t parms) {
        parms.reps, parms.length, parms.delay, parms.end_delay, parms.freq);
 
   /* 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 */