mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git
synced 2026-01-26 14:13:24 +00:00
25 lines
372 B
C
25 lines
372 B
C
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <errno.h>
|
|
|
|
#include "libcommon.h"
|
|
|
|
int main(int argc KBD_ATTR_UNUSED, char **argv KBD_ATTR_UNUSED)
|
|
{
|
|
int console;
|
|
char *name;
|
|
|
|
if (!isatty(0))
|
|
return EXIT_SUCCESS;
|
|
|
|
console = getfd(NULL);
|
|
name = ttyname(console);
|
|
close(console);
|
|
|
|
console = getfd(name);
|
|
close(console);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|