From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17412 invoked from network); 29 May 2001 09:29:48 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 09:29:48 -0000 Received: (qmail 47 invoked by alias); 29 May 2001 09:29:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14524 Received: (qmail 29946 invoked from network); 29 May 2001 09:29:36 -0000 From: Sven Wischnowsky Date: Tue, 29 May 2001 11:28:40 +0200 (MET DST) Message-Id: <200105290928.LAA09000@beta.informatik.hu-berlin.de> To: zsh-workers@sunsite.dk Subject: Re: Disowning a stopped job In-Reply-To: <010522134558.ZM22847@candle.brasslantern.com> Bart Schaefer wrote: > Using "disown" on a stopped job leaves the job stopped. There should be at > least a warning about this. Nobody answered -- or did I miss something? The patch below makes it print a warning. Simple change, but I'm not sure I like it. It looks as if disown were complaining, i.e. as if it didn't actually disown the job. I tried to make that clearer by putting that `warning' in the message, but still... The other possibilities would of course be to generate an error, not disowning the job or to call makerunning() on it before clearing the job table entry. Of these, I think I prefer the former. The user can then still call `bg' and then `disown'. Bye Sven Index: Src/jobs.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v retrieving revision 1.10 diff -u -r1.10 jobs.c --- Src/jobs.c 2001/02/20 09:16:47 1.10 +++ Src/jobs.c 2001/05/29 09:24:49 @@ -1392,6 +1392,14 @@ printjob(job + jobtab, lng, 2); break; case BIN_DISOWN: + if (jobtab[job].stat & STAT_STOPPED) + zwarnnam(name, +#ifdef USE_SUSPENDED + "warning: job is suspended", +#else + "warning: job is stopped", +#endif + NULL, 0); deletejob(jobtab + job); break; } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de