kbd/tests/libcommon/libcommon-test03.c
Alexey Gladkov 854faf77da
tests: Add tests to increase code coverage
Signed-off-by: Alexey Gladkov <legion@kernel.org>
2025-05-21 23:58:33 +02:00

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;
}