From 2c6c4ab2f5523940df64af205315612d89b818f0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 1 Oct 2015 21:11:12 +0200 Subject: logind: remove warn_melody() logic The internal speaker is usually not available on modern latops that support suspend, and even if it is available in the hardware, most distributions turned support for it off in the kernel. And even if it is enabled, it's probably still a bad idea to make use of it for the suspend-failures. If anything a proper sound should be played. Long story short, let's remove support of this anachronism. --- src/basic/terminal-util.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/basic/terminal-util.c') diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 287e0dfa13..22ee6ad83f 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -607,27 +607,6 @@ int vt_disallocate(const char *name) { return 0; } -void warn_melody(void) { - _cleanup_close_ int fd = -1; - - fd = open("/dev/console", O_WRONLY|O_CLOEXEC|O_NOCTTY); - if (fd < 0) - return; - - /* Yeah, this is synchronous. Kinda sucks. But well... */ - - (void) ioctl(fd, KIOCSOUND, (int)(1193180/440)); - usleep(125*USEC_PER_MSEC); - - (void) ioctl(fd, KIOCSOUND, (int)(1193180/220)); - usleep(125*USEC_PER_MSEC); - - (void) ioctl(fd, KIOCSOUND, (int)(1193180/220)); - usleep(125*USEC_PER_MSEC); - - (void) ioctl(fd, KIOCSOUND, 0); -} - int make_console_stdio(void) { int fd, r; -- cgit v1.2.3-54-g00ecf