comparison src/s/usg5-4.h @ 5340:9dd4559b9e9a

Try again, s/usg5-4.h, this type with qxestrcpy_ascii(), etc. 2011-01-15 Aidan Kehoe <kehoea@parhasard.net> * s/usg5-4.h (PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF): That didn't work; attempt with qxestrcpy_ascii(), qxestrncpy_ascii().
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 15 Jan 2011 17:24:06 +0000
parents 906ccc7dcd70
children a9094f28f9a9
comparison
equal deleted inserted replaced
5339:ba62563ec7c7 5340:9dd4559b9e9a
122 #include <sys/termios.h> 122 #include <sys/termios.h>
123 #endif 123 #endif
124 124
125 /* This sets the name of the master side of the PTY. */ 125 /* This sets the name of the master side of the PTY. */
126 126
127 #define PTY_NAME_SPRINTF qxestrcpy (pty_name, "/dev/ptmx"); 127 #define PTY_NAME_SPRINTF qxestrcpy_ascii (pty_name, "/dev/ptmx");
128 128
129 /* This sets the name of the slave side of the PTY. On SysVr4, 129 /* This sets the name of the slave side of the PTY. On SysVr4,
130 grantpt(3) forks a subprocess, so keep sigchld_handler() from 130 grantpt(3) forks a subprocess, so keep sigchld_handler() from
131 intercepting that death. If any child but grantpt's should die 131 intercepting that death. If any child but grantpt's should die
132 within, it should be caught after EMACS_UNBLOCK_SIGNAL. */ 132 within, it should be caught after EMACS_UNBLOCK_SIGNAL. */
148 EMACS_UNBLOCK_SIGCHLD; \ 148 EMACS_UNBLOCK_SIGCHLD; \
149 if (unlockpt (fd) == -1) \ 149 if (unlockpt (fd) == -1) \
150 { close (fd); return -1; } \ 150 { close (fd); return -1; } \
151 if (!(ptyname = ptsname (fd))) \ 151 if (!(ptyname = ptsname (fd))) \
152 { close (fd); return -1; } \ 152 { close (fd); return -1; } \
153 qxestrncpy (pty_name, ptyname, sizeof (pty_name)); \ 153 qxestrncpy_ascii (pty_name, ptyname, \
154 sizeof (pty_name)); \
154 pty_name[sizeof (pty_name) - 1] = 0; \ 155 pty_name[sizeof (pty_name) - 1] = 0; \
155 } 156 }
156 157
157 /* Push various streams modules onto a PTY channel. */ 158 /* Push various streams modules onto a PTY channel. */
158 159