mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
pty: changed pstname_r to ptsname for OSX compatibility
This commit is contained in:
parent
ba6f6fc127
commit
e496024c9c
@ -118,10 +118,14 @@ file_error sdl_close_ptty(osd_file *file)
|
|||||||
|
|
||||||
file_error sdl_slave_name_ptty(osd_file *file , char *name , size_t name_len)
|
file_error sdl_slave_name_ptty(osd_file *file , char *name , size_t name_len)
|
||||||
{
|
{
|
||||||
if (ptsname_r(file->handle , name , name_len) < 0) {
|
const char *slave_name = ptsname(file->handle);
|
||||||
|
|
||||||
|
if (slave_name == NULL || strlen(slave_name) >= name_len) {
|
||||||
return FILERR_INVALID_ACCESS;
|
return FILERR_INVALID_ACCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strcpy(name , slave_name);
|
||||||
|
|
||||||
return FILERR_NONE;
|
return FILERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user