Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
7ac098ff
Commit
7ac098ff
authored
Jan 08, 1996
by
Karl Heuer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(PTY_TTY_NAME_SPRINTF): Make failure non-fatal.
parent
48240339
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/s/sol2-3.h
src/s/sol2-3.h
+11
-11
No files found.
src/s/sol2-3.h
View file @
7ac098ff
...
...
@@ -35,16 +35,16 @@
#undef PTY_TTY_NAME_SPRINTF
#define PTY_TTY_NAME_SPRINTF \
{ \
char *ptsname(), *ptyname; \
char *ptsname
(), *ptyname; \
\
sigblock(sigmask(SIGCLD));
\
if (grantpt(fd) == -1) \
fatal("could not grant slave pty");
\
sigunblock(sigmask(SIGCLD)); \
if (unlockpt(fd) == -1) \
fatal("could not unlock slave pty");
\
if (!(ptyname = ptsname(fd))) \
fatal ("could not enable slave pty");
\
strncpy(pty_name, ptyname, sizeof(pty_name)); \
pty_name[sizeof(pty_name) - 1] = 0;
\
sigblock
(sigmask
(SIGCLD)); \
if (grantpt
(fd) == -1) \
{ close (fd); return -1; }
\
sigunblock
(sigmask
(SIGCLD)); \
if (unlockpt
(fd) == -1) \
{ close (fd); return -1; }
\
if (!(ptyname = ptsname
(fd))) \
{ close (fd); return -1; }
\
strncpy
(pty_name, ptyname, sizeof
(pty_name)); \
pty_name[sizeof
(pty_name) - 1] = 0; \
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment