From 3c56463d85bfbf3b249aaa41791eec521b86b230 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 14 Aug 2020 19:18:05 -0400 Subject: move internal ctermid storage to __stdio struct --- src/unistd/ctermid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/unistd') diff --git a/src/unistd/ctermid.c b/src/unistd/ctermid.c index 32a47b64..122bed8a 100644 --- a/src/unistd/ctermid.c +++ b/src/unistd/ctermid.c @@ -2,16 +2,16 @@ #include "sys/types.h" #include #include "stdio.h" +#include "stdio/_stdio.h" #include "string.h" char * ctermid(char * s) { - static char termid[L_ctermid] = "/dev/tty"; - + /* TODO: return the empty string if there is no controlling terminal */ if (s == NULL) { - s = termid; + s = __stdio.ctermid; } else { - strcpy(s, termid); + strcpy(s, __stdio.ctermid); } return s; -- cgit v1.2.1