[libc-commits] [PATCH] D136143: [libc] Add termios.h and the implementation of functions declared in it.
Michael Jones via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Oct 18 10:20:03 PDT 2022
michaelrj added inline comments.
================
Comment at: libc/src/termios/linux/cfsetispeed.cpp:20
+ constexpr speed_t NOT_SPEED_MASK = ~speed_t(CBAUD);
+ // A speed value is valid only if is equal to one of the B<NN+> values.
+ if (t == nullptr || ((speed & NOT_SPEED_MASK) != 0)) {
----------------
nit: `if it is`
================
Comment at: libc/src/termios/linux/cfsetospeed.cpp:20
+ constexpr speed_t NOT_SPEED_MASK = ~speed_t(CBAUD);
+ // A speed value is valid only if is equal to one of the B<NN+> values.
+ if (t == nullptr || ((speed & NOT_SPEED_MASK) != 0)) {
----------------
same as above
================
Comment at: libc/test/src/termios/termios_test.cpp:48
+ errno = 0;
+ int fd = __llvm_libc::open("/dev/tty", O_RDONLY);
+ ASSERT_EQ(errno, 0);
----------------
this will fail on the buildbot, you need to put the rest of the test inside an `if(fd > 0)` clause, similar to how `isatty_test.cpp` does it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136143/new/
https://reviews.llvm.org/D136143
More information about the libc-commits
mailing list