Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:GA
luit
u_luit-Set-up-terminal-before-fork.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File u_luit-Set-up-terminal-before-fork.diff of Package luit
From 6b1da100f2984701f181f5d2635ffcff06db9be1 Mon Sep 17 00:00:00 2001 From: Mike Fabian <mike.fabian@gmx.de> Date: Tue, 7 Jun 2011 13:42:00 +0200 Subject: [PATCH] Set up terminal before fork. Patch-mainline: To be submitted. After the fork it is undefined wether parent or child runs first. So there can be a race: if the child runs before the terminal of the parent is set up correctly luit may hang. This patch sets up the terminal before forking and undoes the settings in the child. Signed-off-by: Egbert Eich <eich@freedesktop.org> --- luit.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) Index: luit-20130217/luit.c =================================================================== --- luit-20130217.orig/luit.c +++ luit-20130217/luit.c @@ -776,6 +776,8 @@ condom(int argc, char **argv) IGNORE_RC(pipe(c2p_waitpipe)); } + setup_io(pty); + TRACE(("...forking to run %s(%s)\n", path, child_argv[0])); pid = fork(); if (pid < 0) { @@ -784,6 +786,10 @@ condom(int argc, char **argv) } if (pid == 0) { +#ifdef SIGWINCH + installHandler(SIGWINCH, SIG_DFL); +#endif + installHandler(SIGCHLD, SIG_DFL); close(pty); if (pipe_option) { close_waitpipe(1); @@ -865,7 +871,6 @@ parent(int pid GCC_UNUSED, int pty) if (verbose) { reportIso2022("Output", outputState); } - setup_io(pty); if (pipe_option) { write_waitpipe(p2c_waitpipe);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor