zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: Disowning a stopped job
Date: Tue, 29 May 2001 11:28:40 +0200 (MET DST)	[thread overview]
Message-ID: <200105290928.LAA09000@beta.informatik.hu-berlin.de> (raw)
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


  reply	other threads:[~2001-05-29  9:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-22 20:45 Bart Schaefer
2001-05-29  9:28 ` Sven Wischnowsky [this message]
2001-05-29 15:12   ` Bart Schaefer
2001-05-30  7:26     ` Sven Wischnowsky
2001-05-30 13:42     ` Sven Wischnowsky
2001-05-26 16:24 tag-order problem? Tanaka Akira
2001-05-28  8:26 ` Sven Wischnowsky
2001-05-28  9:23   ` Tanaka Akira
2001-05-28 10:30     ` Sven Wischnowsky
2001-05-31 12:35       ` PATCH: " Sven Wischnowsky
2001-05-31 14:15         ` Disowning a stopped job Bart Schaefer
2001-05-31 15:28           ` Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200105290928.LAA09000@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).