Let tcgetattr succeed for libc_log
At the startup of python's termios module, a sequence of 'tcgetattr' and
'tcsetattr' calls is executed. If one of those calls fails, the
initialization gets canceled. 'tcgetattr' is implemented via ioctl
operations on stdout. To let those operations succeed, the default
implementation of ioctl ('Plugin::ioctl') cannot be used because it
returns -1. Adding a dummy ioctl to the libc_log back end alleviates
this problem.
This commit is contained in:
@@ -96,6 +96,18 @@ namespace {
|
||||
}
|
||||
return orig_count;
|
||||
}
|
||||
|
||||
int ioctl(Libc::File_descriptor *, int request, char *)
|
||||
{
|
||||
/*
|
||||
* Some programs or libraries use to perform 'TIOCGETA'
|
||||
* operations on stdout, in particular the termios module of
|
||||
* Python. Those programs may break if 'tcgetattr' return with
|
||||
* an error. We pretend to be more successful than we really
|
||||
* are to make them happy.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user