Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311037 Details for
Bug 435159
scripts failing under ksh
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Backport from 2006-06-24
ksh-20080202-ulimit.patch (text/plain), 4.68 KB, created by
Tomas Smetana
on 2008-07-04 12:40:32 UTC
(
hide
)
Description:
Backport from 2006-06-24
Filename:
MIME Type:
Creator:
Tomas Smetana
Created:
2008-07-04 12:40:32 UTC
Size:
4.68 KB
patch
obsolete
>diff -up ksh-20080202/src/cmd/ksh93/sh/xec.c.ulimit ksh-20080202/src/cmd/ksh93/sh/xec.c >--- ksh-20080202/src/cmd/ksh93/sh/xec.c.ulimit 2008-01-25 20:35:25.000000000 +0100 >+++ ksh-20080202/src/cmd/ksh93/sh/xec.c 2008-07-04 10:57:57.000000000 +0200 >@@ -2117,33 +2117,39 @@ static void timed_out(void *handle) > pid_t _sh_fork(register pid_t parent,int flags,int *jobid) > { > static long forkcnt = 1000L; >+ Shell_t *shp = &sh; > pid_t curpgid = job.curpgid; > pid_t postid = (flags&FAMP)?0:curpgid; >- int sig; >+ int sig,nochild; > if(parent<0) > { >+ sh_sigcheck(); > if((forkcnt *= 2) > 1000L*SH_FORKLIM) > { > forkcnt=1000L; > errormsg(SH_DICT,ERROR_system(ERROR_NOEXEC),e_nofork); > } >- sh_sigcheck(); > timeout = (void*)sh_timeradd(forkcnt, 0, timed_out, NIL(void*)); >- job_wait((pid_t)1); >+ nochild = job_wait((pid_t)1); > if(timeout) > { >+ if(nochild) >+ pause(); >+ else if(forkcnt>1000L) >+ forkcnt /= 2; > timerdel(timeout); >- forkcnt /= 2; >+ timeout = 0; > } > return(-1); > } >- forkcnt=1000L; >+ forkcnt = 1000L; > if(parent) > { >- int myjob; >- sh.nforks++; >+ int myjob,waitall=job.waitall; >+ shp->nforks++; > if(job.toclear) > job_clear(); >+ job.waitall = waitall; > #ifdef JOBS > /* first process defines process group */ > if(sh_isstate(SH_MONITOR)) >@@ -2164,7 +2170,7 @@ pid_t _sh_fork(register pid_t parent,int > if(!sh_isstate(SH_MONITOR) && job.waitall && postid==0) > job.curpgid = parent; > if(flags&FCOOP) >- sh.cpid = parent; >+ shp->cpid = parent; > myjob = job_post(parent,postid); > if(flags&FAMP) > job.curpgid = curpgid; >@@ -2176,9 +2182,9 @@ pid_t _sh_fork(register pid_t parent,int > vmtrace(-1); > #endif > /* This is the child process */ >- if(sh.trapnote&SH_SIGTERM) >+ if(shp->trapnote&SH_SIGTERM) > sh_exit(SH_EXITSIG|SIGTERM); >- sh.nforks=0; >+ shp->nforks=0; > timerdel(NIL(void*)); > #ifdef JOBS > if(!job.jobcontrol && !(flags&FAMP)) >@@ -2206,22 +2212,22 @@ pid_t _sh_fork(register pid_t parent,int > job.jobcontrol = 0; > #endif /* JOBS */ > job.toclear = 1; >- sh.login_sh = 0; >+ shp->login_sh = 0; > sh_offoption(SH_LOGIN_SHELL); > sh_onstate(SH_FORKED); > sh_onstate(SH_NOLOG); >- sh.fn_depth = 0; >+ shp->fn_depth = 0; > #if SHOPT_ACCT > sh_accsusp(); > #endif /* SHOPT_ACCT */ > /* Reset remaining signals to parent */ > /* except for those `lost' by trap */ > sh_sigreset(2); >- sh.subshell = 0; >- if((flags&FAMP) && sh.coutpipe>1) >- sh_close(sh.coutpipe); >- sig = sh.savesig; >- sh.savesig = 0; >+ shp->subshell = 0; >+ if((flags&FAMP) && shp->coutpipe>1) >+ sh_close(shp->coutpipe); >+ sig = shp->savesig; >+ shp->savesig = 0; > if(sig>0) > sh_fault(sig); > sh_sigcheck(); >diff -up ksh-20080202/src/cmd/ksh93/sh/jobs.c.ulimit ksh-20080202/src/cmd/ksh93/sh/jobs.c >--- ksh-20080202/src/cmd/ksh93/sh/jobs.c.ulimit 2008-07-04 11:11:51.000000000 +0200 >+++ ksh-20080202/src/cmd/ksh93/sh/jobs.c 2008-07-04 11:00:47.000000000 +0200 >@@ -1219,11 +1219,11 @@ static void job_prmsg(register struct pr > * pid=-1 to wait for all runing processes > */ > >-void job_wait(register pid_t pid) >+int job_wait(register pid_t pid) > { > register struct process *pw=0,*px; > register int jobid = 0; >- int nochild; >+ int nochild = 1; > char intr = 0; > if(pid <= 0) > { >@@ -1242,13 +1242,13 @@ void job_wait(register pid_t pid) > sh.exitval = ERROR_NOENT; > exitset(); > job_unlock(); >- return; >+ return(nochild); > } > else if(intr && pw->p_env!=sh.curenv) > { > sh.exitval = ERROR_NOENT; > job_unlock(); >- return; >+ return(nochild); > } > jobid = pw->p_job; > if(!intr) >@@ -1362,7 +1362,7 @@ void job_wait(register pid_t pid) > } > job_unlock(); > if(pid==1) >- return; >+ return(nochild); > exitset(); > if(pw->p_pgrp) > { >@@ -1379,10 +1379,18 @@ void job_wait(register pid_t pid) > #endif /* SIGTSTP */ > } > else >+ { >+ if(pw->p_pid == tcgetpgrp(JOBTTY)) >+ { >+ if(pw->p_pgrp==0) >+ pw->p_pgrp = pw->p_pid; >+ job_reset(pw); >+ } > tty_set(-1, 0, NIL(struct termios*)); >+ } > done: > if(!job.waitall && sh_isoption(SH_PIPEFAIL)) >- return; >+ return(nochild); > if(!sh.intrap) > { > job_lock(); >@@ -1393,6 +1401,7 @@ done: > } > job_unlock(); > } >+ return(nochild); > } > > /* >diff -up ksh-20080202/src/cmd/ksh93/include/jobs.h.ulimit ksh-20080202/src/cmd/ksh93/include/jobs.h >--- ksh-20080202/src/cmd/ksh93/include/jobs.h.ulimit 2007-09-11 23:54:31.000000000 +0200 >+++ ksh-20080202/src/cmd/ksh93/include/jobs.h 2008-07-04 11:01:53.000000000 +0200 >@@ -149,7 +149,7 @@ extern void job_clear(void); > extern void job_bwait(char**); > extern int job_walk(Sfio_t*,int(*)(struct process*,int),int,char*[]); > extern int job_kill(struct process*,int); >-extern void job_wait(pid_t); >+extern int job_wait(pid_t); > extern int job_post(pid_t,pid_t); > extern void *job_subsave(void); > extern void job_subrestore(void*);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435159
:
310235
| 311037 |
311902
|
312590
|
323354