]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: remove warn_melody() logic 1439/head
authorLennart Poettering <lennart@poettering.net>
Thu, 1 Oct 2015 19:11:12 +0000 (21:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 1 Oct 2015 19:11:12 +0000 (21:11 +0200)
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
src/basic/terminal-util.h
src/login/logind-action.c

index 287e0dfa1351db61b70a010b6387c8ba5fd72764..22ee6ad83fd7cf1e617dd1d639f777fd292ff5df 100644 (file)
@@ -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;
 
index a9e325ccb319b5a7f9af622c4b6df7e813346661..da2a5b88976cc5579487e5f0c2110dac6a04a229 100644 (file)
@@ -67,8 +67,6 @@ bool tty_is_console(const char *tty) _pure_;
 int vtnr_from_tty(const char *tty);
 const char *default_term_for_tty(const char *tty);
 
-void warn_melody(void);
-
 int make_stdio(int fd);
 int make_null_stdio(void);
 int make_console_stdio(void);
index f635fb1b632039a459d4f0de245279a7d6e03faa..a44e369149f51875be6862c34a81454e4b487823 100644 (file)
@@ -147,7 +147,6 @@ int manager_handle_action(
                           offending->uid, strna(u),
                           offending->pid, strna(comm));
 
-                warn_melody();
                 return -EPERM;
         }