mirror of https://github.com/ARMmbed/mbed-os.git
Minimal Console: Fix compilation error
Build successfully when `platform.stdio-convert-tty-newlines` or `platform.stdio-convert-newlines` are set to `true` by ensuring `isatty()` is also included when `platform.stdio-minimal-console-only` is set to `true`.pull/11959/head
parent
d5f813b6a3
commit
240758db42
|
@ -573,10 +573,10 @@ extern "C" {
|
||||||
ssize_t write(int fildes, const void *buf, size_t nbyte);
|
ssize_t write(int fildes, const void *buf, size_t nbyte);
|
||||||
ssize_t read(int fildes, void *buf, size_t nbyte);
|
ssize_t read(int fildes, void *buf, size_t nbyte);
|
||||||
int fsync(int fildes);
|
int fsync(int fildes);
|
||||||
|
int isatty(int fildes);
|
||||||
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
||||||
off_t lseek(int fildes, off_t offset, int whence);
|
off_t lseek(int fildes, off_t offset, int whence);
|
||||||
int ftruncate(int fildes, off_t length);
|
int ftruncate(int fildes, off_t length);
|
||||||
int isatty(int fildes);
|
|
||||||
int fstat(int fildes, struct stat *st);
|
int fstat(int fildes, struct stat *st);
|
||||||
int fcntl(int fildes, int cmd, ...);
|
int fcntl(int fildes, int cmd, ...);
|
||||||
int poll(struct pollfd fds[], nfds_t nfds, int timeout);
|
int poll(struct pollfd fds[], nfds_t nfds, int timeout);
|
||||||
|
|
|
@ -915,17 +915,13 @@ extern "C" int PREFIX(_istty)(FILEHANDLE fh)
|
||||||
extern "C" int _isatty(FILEHANDLE fh)
|
extern "C" int _isatty(FILEHANDLE fh)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
|
||||||
return isatty(fh);
|
return isatty(fh);
|
||||||
#else
|
|
||||||
// Is attached to an interactive device
|
|
||||||
return 1;
|
|
||||||
#endif // !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
|
||||||
extern "C" int isatty(int fildes)
|
extern "C" int isatty(int fildes)
|
||||||
{
|
{
|
||||||
|
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
||||||
FileHandle *fhc = mbed_file_handle(fildes);
|
FileHandle *fhc = mbed_file_handle(fildes);
|
||||||
if (fhc == NULL) {
|
if (fhc == NULL) {
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
|
@ -939,8 +935,11 @@ extern "C" int isatty(int fildes)
|
||||||
} else {
|
} else {
|
||||||
return tty;
|
return tty;
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
|
// Is attached to an interactive device
|
||||||
|
return 1;
|
||||||
#endif // !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
#endif // !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
|
||||||
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
#if defined(__ARMCC_VERSION)
|
#if defined(__ARMCC_VERSION)
|
||||||
|
|
Loading…
Reference in New Issue