Skip to content

Commit

Permalink
hashcat-cli.c: fix build against musl libc
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rofl0r committed Nov 25, 2016
1 parent 2f300e0 commit f9a28a7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/hashcat-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
#include "engine.h"

// for interactive status prompt
#if defined OSX || defined FREEBSD
#if defined OSX || defined FREEBSD || defined LINUX
#include <termios.h>
#include <sys/ioctl.h>
#endif

#if defined LINUX
#include <termio.h>
#endif

#define USAGE_VIEW 0
#define VERSION_VIEW 0
#define QUIET 0
Expand Down Expand Up @@ -2939,12 +2935,12 @@ int tty_fix ()
#endif

#if defined LINUX
static struct termio savemodes;
static struct termios savemodes;
static int havemodes = 0;

int tty_break ()
{
struct termio modmodes;
struct termios modmodes;

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

Expand Down

0 comments on commit f9a28a7

Please sign in to comment.