summaryrefslogtreecommitdiff
path: root/system.c
diff options
context:
space:
mode:
authorDave Hibberd <d@vehibberd.com>2021-01-27 21:26:06 +0000
committerDave Hibberd <d@vehibberd.com>2021-01-27 21:26:06 +0000
commit28d452f5b0992f3f46f3549db73561420e745fca (patch)
tree459d776925f5efa04cbb1763b98e9bc33c21813e /system.c
parent5f0010158aa7cf56ef8fd2f3346dc9bf8074d5ae (diff)
New upstream version 2.13
Diffstat (limited to 'system.c')
-rw-r--r--system.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/system.c b/system.c
index 2e69ef4..965688f 100644
--- a/system.c
+++ b/system.c
@@ -73,8 +73,9 @@ int cusgets(char *buf, int buflen, ax25io *iop)
}
/*---------------------------------------------------------------------------*/
+#define _XOPEN_SOURCE
-int find_pty(char *ptyname)
+int find_pty(char **ptyname)
{
char master[80];
int fd;
@@ -83,10 +84,11 @@ int find_pty(char *ptyname)
for(num = lastnum + 1; ; num++) {
if (num >= NUMPTY) num = 0;
- sprintf(master, "/dev/pty%c%x", 'p' + (num >> 4), num & 0xf);
+// sprintf(master, "/dev/ptmx%c%x", 'p' + (num >> 4), num & 0xf);
+ sprintf(master, "/dev/ptmx", O_RDWR);
/* sprintf(master, "/dev/pts/%x", num & 0xf); */
if ((fd = open(master, O_RDWR | O_NONBLOCK, 0600)) >= 0) {
- sprintf(ptyname, "/dev/tty%c%x", 'p' + (num >> 4), num & 0xf);
+ sprintf(ptyname, "/dev/ptmx", 'p' + (num >> 4), num & 0xf);
/* sprintf(ptyname, "/dev/pts/%x", num & 0xf); */
lastnum = num;
return fd;
@@ -496,7 +498,7 @@ void lastlog(void)
break;
#endif
case AF_INET: strcpy(hostname, User.call);
- strcat(hostname, " on IPv4 ");
+ strcat(hostname, " from ip ");
strcat(hostname, User.ul_name);
break;
case AF_INET6: strcpy(hostname6, User.ul_name);