summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/sdlptty_unix.c
diff options
context:
space:
mode:
author fulivi <fulivi@users.noreply.github.com>2015-10-17 18:26:41 +0200
committer fulivi <fulivi@users.noreply.github.com>2015-10-17 18:26:41 +0200
commite496024c9ca4e30b19cfcc48cffdfb766a238ee8 (patch)
treed6e1f6ead202cbf00614f51f3115940200bdb455 /src/osd/sdl/sdlptty_unix.c
parentba6f6fc1272a9dce9beca9726d87a09d80744283 (diff)
pty: changed pstname_r to ptsname for OSX compatibility
Diffstat (limited to 'src/osd/sdl/sdlptty_unix.c')
-rw-r--r--src/osd/sdl/sdlptty_unix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/osd/sdl/sdlptty_unix.c b/src/osd/sdl/sdlptty_unix.c
index 13cd3eb1034..aeca6fd4baf 100644
--- a/src/osd/sdl/sdlptty_unix.c
+++ b/src/osd/sdl/sdlptty_unix.c
@@ -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)
{
- 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;
}
+ strcpy(name , slave_name);
+
return FILERR_NONE;
}