diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-03 19:05:43 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-08-03 19:07:33 +0200 |
commit | 7d927c9a4d3e05a87659e89844a7d26bb0b86d8b (patch) | |
tree | 206c109232ba5acec852b81a12c8e2629daa86c7 /src/basic | |
parent | 0a8b555ceb07ce916b9bd48782d1eb69a12f0f2e (diff) |
terminal-util: cast a couple of ioctl()s to void
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/terminal-util.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 20edfddf5b..f4c7489e09 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -230,14 +230,14 @@ int reset_terminal_fd(int fd, bool switch_to_text) { * interfere with that. */ /* Disable exclusive mode, just in case */ - ioctl(fd, TIOCNXCL); + (void) ioctl(fd, TIOCNXCL); /* Switch to text mode */ if (switch_to_text) - ioctl(fd, KDSETMODE, KD_TEXT); + (void) ioctl(fd, KDSETMODE, KD_TEXT); /* Enable console unicode mode */ - ioctl(fd, KDSKBMODE, K_UNICODE); + (void) ioctl(fd, KDSKBMODE, K_UNICODE); if (tcgetattr(fd, &termios) < 0) { r = -errno; @@ -276,7 +276,7 @@ int reset_terminal_fd(int fd, bool switch_to_text) { finish: /* Just in case, flush all crap out */ - tcflush(fd, TCIOFLUSH); + (void) tcflush(fd, TCIOFLUSH); return r; } @@ -417,9 +417,8 @@ int acquire_terminal( if (r < 0 && r == -EPERM && ignore_tiocstty_eperm) r = 0; - if (r < 0 && (force || fail || r != -EPERM)) { + if (r < 0 && (force || fail || r != -EPERM)) goto fail; - } if (r >= 0) break; @@ -616,16 +615,16 @@ void warn_melody(void) { /* Yeah, this is synchronous. Kinda sucks. But well... */ - ioctl(fd, KIOCSOUND, (int)(1193180/440)); + (void) ioctl(fd, KIOCSOUND, (int)(1193180/440)); usleep(125*USEC_PER_MSEC); - ioctl(fd, KIOCSOUND, (int)(1193180/220)); + (void) ioctl(fd, KIOCSOUND, (int)(1193180/220)); usleep(125*USEC_PER_MSEC); - ioctl(fd, KIOCSOUND, (int)(1193180/220)); + (void) ioctl(fd, KIOCSOUND, (int)(1193180/220)); usleep(125*USEC_PER_MSEC); - ioctl(fd, KIOCSOUND, 0); + (void) ioctl(fd, KIOCSOUND, 0); } int make_console_stdio(void) { |