Skip to content

Commit f9a28a7

Browse files
committed
hashcat-cli.c: fix build against musl libc
GLIBC's termio.h is just an empty file with 2 include directives: #include <termios.h> #include <sys/ioctl.h> and a comment that says that it is obsolete and you should use termios.h and struct termios instead - exactly what musl libc does. since the obsolete interface was replaced with termios by POSIX, musl only implements the standardized interface.
1 parent 2f300e0 commit f9a28a7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/hashcat-cli.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@
2222
#include "engine.h"
2323

2424
// for interactive status prompt
25-
#if defined OSX || defined FREEBSD
25+
#if defined OSX || defined FREEBSD || defined LINUX
2626
#include <termios.h>
2727
#include <sys/ioctl.h>
2828
#endif
2929

30-
#if defined LINUX
31-
#include <termio.h>
32-
#endif
33-
3430
#define USAGE_VIEW 0
3531
#define VERSION_VIEW 0
3632
#define QUIET 0
@@ -2939,12 +2935,12 @@ int tty_fix ()
29392935
#endif
29402936

29412937
#if defined LINUX
2942-
static struct termio savemodes;
2938+
static struct termios savemodes;
29432939
static int havemodes = 0;
29442940

29452941
int tty_break ()
29462942
{
2947-
struct termio modmodes;
2943+
struct termios modmodes;
29482944

29492945
if (ioctl (fileno (stdin), TCGETA, &savemodes) < 0) return -1;
29502946

0 commit comments

Comments
 (0)