Skip to content

Commit

Permalink
[Muslc] Fix stty
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoMagdaleno committed Aug 10, 2021
1 parent 22141d6 commit 006cee9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_definitions("-DDEFFILEMODE=(S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)")
add_definitions("-DACCESSPERMS=(S_IRWXU|S_IRWXG|S_IRWXO)")
add_definitions(-DREG_STARTEND=0)
# Should we really define it as 512?
add_definitions(-DS_BLKSIZE=512)
endif()

add_subdirectory(compat)
Expand Down
1 change: 1 addition & 0 deletions src/stty/cchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/

#include <sys/types.h>
#include <sys/ttydefaults.h>
#include <sys/ioctl.h>

#include <err.h>
Expand Down
5 changes: 3 additions & 2 deletions src/stty/gfmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ gread(struct termios *tp, char *s)
continue;
}
if (CHK("ispeed")) {
/* Thanks Microsoft!: https://github.com/Microsoft/node-pty/issues/40 */
(void)sscanf(ep, "%ld", &tmp);
tp->c_ispeed = tmp;
cfsetispeed(tp, tmp);
continue;
}
if (CHK("lflag")) {
Expand All @@ -103,7 +104,7 @@ gread(struct termios *tp, char *s)
}
if (CHK("ospeed")) {
(void)sscanf(ep, "%ld", &tmp);
tp->c_ospeed = tmp;
cfsetospeed(tp, tmp);
continue;
}
for (cp = cchars1; cp->name != NULL; ++cp)
Expand Down
9 changes: 7 additions & 2 deletions src/stty/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ttydefaults.h>

#include <err.h>
#include <errno.h>
Expand All @@ -46,7 +47,9 @@

#include "compat.h"

__BEGIN_DECLS
#ifdef __cplusplus
extern "C" {
#endif
void f_all(struct info *);
void f_cbreak(struct info *);
void f_columns(struct info *);
Expand All @@ -64,7 +67,9 @@ void f_sane(struct info *);
void f_size(struct info *);
void f_speed(struct info *);
void f_tty(struct info *);
__END_DECLS
#ifdef __cplusplus
}
#endif

static struct key {
char *name; /* name */
Expand Down

0 comments on commit 006cee9

Please sign in to comment.