all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "William K. Foster" <wkf@alum.mit.edu>
To: bug-gnu-emacs@gnu.org
Subject: bug#2602: Emacs shell exits when executed command sets stdout and stderr to be non-blocking
Date: Sun, 8 Mar 2009 13:56:48 -0700	[thread overview]
Message-ID: <aca4364f0903081356m4eacd6f8k3500f133a8df4144@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

Hello,

Create an application that does the following:

  void setFdBlocking(int fd, bool block) {
    // Set an fd's blocking flag on or off.
    int flags;

    if (0 > (flags = fcntl(fd, F_GETFL, 0))) {
      throw;
    }

    if (block) {
      flags &= ~O_NONBLOCK;
    } else {
      flags |=  O_NONBLOCK;
    }

    if (0 > fcntl(fd, F_SETFL, flags)) {
      throw;
    }
  }

  // Make Stdout and Stderr be non-blocking.
  setFdBlocking(1, false);
  setFdBlocking(2, false);

If you execute the application from a shell inside emacs, the shell will
exit when the command returns.

This does not happen for a shell outside of emacs.

Thanks.

-William

[-- Attachment #2: Type: text/html, Size: 783 bytes --]

             reply	other threads:[~2009-03-08 20:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-08 20:56 William K. Foster [this message]
2016-01-24 22:03 ` bug#2602: Emacs shell exits when executed command sets stdout and stderr to be non-blocking Andrew Hyatt

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=aca4364f0903081356m4eacd6f8k3500f133a8df4144@mail.gmail.com \
    --to=wkf@alum.mit.edu \
    --cc=2602@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.