Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
ca860459
Commit
ca860459
authored
8 years ago
by
Mike Frysinger
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
handle builds on systems without termios.h
Windows doesn't have this, so add some build time checks.
parent
cab33779
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+1
-1
configure.ac
src/nano.c
+17
-0
src/nano.c
with
18 additions
and
1 deletion
+18
-1
configure.ac
View file @
ca860459
...
...
@@ -57,7 +57,7 @@ AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])
dnl Checks for header files.
AC_CHECK_HEADERS(libintl.h limits.h pwd.h sys/param.h)
AC_CHECK_HEADERS(libintl.h limits.h pwd.h
termios.h
sys/param.h)
dnl Checks for options.
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
ca860459
...
...
@@ -34,7 +34,9 @@
#ifdef ENABLE_UTF8
#include <langinfo.h>
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#include <getopt.h>
#ifndef NANO_TINY
#include <sys/ioctl.h>
...
...
@@ -48,7 +50,12 @@ static int oldinterval = -1;
static
bool
no_rcfiles
=
FALSE
;
/* Should we ignore all rcfiles? */
#endif
#ifdef HAVE_TERMIOS_H
static
struct
termios
oldterm
;
#else
# define tcsetattr(...)
# define tcgetattr(...)
#endif
/* The user's original terminal settings. */
static
struct
sigaction
act
;
/* Used to set up all our fun signal handlers. */
...
...
@@ -1417,23 +1424,27 @@ void do_toggle_void(void)
* settings. */
void
disable_extended_io
(
void
)
{
#ifdef HAVE_TERMIOS_H
struct
termios
term
;
tcgetattr
(
0
,
&
term
);
term
.
c_lflag
&=
~
IEXTEN
;
term
.
c_oflag
&=
~
OPOST
;
tcsetattr
(
0
,
TCSANOW
,
&
term
);
#endif
}
/* Disable interpretation of the special control keys in our terminal
* settings. */
void
disable_signals
(
void
)
{
#ifdef HAVE_TERMIOS_H
struct
termios
term
;
tcgetattr
(
0
,
&
term
);
term
.
c_lflag
&=
~
ISIG
;
tcsetattr
(
0
,
TCSANOW
,
&
term
);
#endif
}
#ifndef NANO_TINY
...
...
@@ -1441,11 +1452,13 @@ void disable_signals(void)
* settings. */
void
enable_signals
(
void
)
{
#ifdef HAVE_TERMIOS_H
struct
termios
term
;
tcgetattr
(
0
,
&
term
);
term
.
c_lflag
|=
ISIG
;
tcsetattr
(
0
,
TCSANOW
,
&
term
);
#endif
}
#endif
...
...
@@ -1453,22 +1466,26 @@ void enable_signals(void)
* settings. */
void
disable_flow_control
(
void
)
{
#ifdef HAVE_TERMIOS_H
struct
termios
term
;
tcgetattr
(
0
,
&
term
);
term
.
c_iflag
&=
~
IXON
;
tcsetattr
(
0
,
TCSANOW
,
&
term
);
#endif
}
/* Enable interpretation of the flow control characters in our terminal
* settings. */
void
enable_flow_control
(
void
)
{
#ifdef HAVE_TERMIOS_H
struct
termios
term
;
tcgetattr
(
0
,
&
term
);
term
.
c_iflag
|=
IXON
;
tcsetattr
(
0
,
TCSANOW
,
&
term
);
#endif
}
/* Set up the terminal state. Put the terminal in raw mode (read one
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help