Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
python-libmount.3345
util-linux-script-backport.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-script-backport.patch of Package python-libmount.3345
From 032228c9af6fbda5177c47c3d410386895957555 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson <andreas@fatal.se> Date: Tue, 14 Oct 2014 12:07:21 +0200 Subject: [PATCH] script: may be hangs Signed-off-by: Karel Zak <kzak@redhat.com> --- term-utils/script.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) From 0b285b84b2f14339fd86857244654ba25fac7d73 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec <sbrabec@suse.cz> Date: Fri, 6 Feb 2015 19:59:14 +0100 Subject: [PATCH] Fix "Script started" buffering race script -c "echo Hallo World" </dev/null >script.log ; cat script.log Before: Hallo World Script started, file is typescript Script started, file is typescript Script done, file is typescript After: Script started, file is typescript Hallo World Script done, file is typescript --- term-utils/script.c | 1 + 1 file changed, 1 insertion(+) Index: util-linux-2.25/term-utils/script.c =================================================================== --- util-linux-2.25.orig/term-utils/script.c +++ util-linux-2.25/term-utils/script.c @@ -80,6 +80,7 @@ #define DEFAULT_OUTPUT "typescript" +void sig_finish(int); void finish(int); void done(void); void fail(void); @@ -258,13 +259,14 @@ main(int argc, char **argv) { /* setup SIGCHLD handler */ sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - sa.sa_handler = finish; + sa.sa_handler = sig_finish; sigaction(SIGCHLD, &sa, NULL); /* init mask for SIGCHLD */ sigprocmask(SIG_SETMASK, NULL, &block_mask); sigaddset(&block_mask, SIGCHLD); + fflush(stdout); sigprocmask(SIG_SETMASK, &block_mask, &unblock_mask); child = fork(); sigprocmask(SIG_SETMASK, &unblock_mask, NULL); @@ -385,17 +387,18 @@ doinput(void) { } if (!die) - finish(0); /* wait for childern */ + finish(1); /* wait for children */ done(); } void -finish(int dummy __attribute__ ((__unused__))) { +finish(int wait) { int status; pid_t pid; int errsv = errno; + int options = wait ? 0 : WNOHANG; - while ((pid = wait3(&status, WNOHANG, 0)) > 0) + while ((pid = wait3(&status, options, 0)) > 0) if (pid == child) { childstatus = status; die = 1; @@ -405,6 +408,11 @@ finish(int dummy __attribute__ ((__unuse } void +sig_finish(int dummy __attribute__ ((__unused__))) { + finish(0); +} + +void resize(int dummy __attribute__ ((__unused__))) { resized = 1; }
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