summaryrefslogtreecommitdiff
path: root/src/unistd/ctermid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/ctermid.c')
-rw-r--r--src/unistd/ctermid.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/unistd/ctermid.c b/src/unistd/ctermid.c
index 122bed8a..fd87684e 100644
--- a/src/unistd/ctermid.c
+++ b/src/unistd/ctermid.c
@@ -1,17 +1,18 @@
-#include "stddef.h"
-#include "sys/types.h"
+#include <stddef.h>
+#include <sys/types.h>
#include <unistd.h>
-#include "stdio.h"
-#include "stdio/_stdio.h"
-#include "string.h"
+#include <stdio.h>
+#include <string.h>
char * ctermid(char * s)
{
+ static char ctid[L_ctermid + 1] = "/dev/tty";
+
/* TODO: return the empty string if there is no controlling terminal */
if (s == NULL) {
- s = __stdio.ctermid;
+ s = ctid;
} else {
- strcpy(s, __stdio.ctermid);
+ strcpy(s, ctid);
}
return s;