GNU bug report logs - #2602
Emacs shell exits when executed command sets stdout and stderr to be non-blocking

Previous Next

Package: emacs;

Reported by: "William K. Foster" <wkf <at> alum.mit.edu>

Date: Mon, 9 Mar 2009 02:10:04 UTC

Severity: normal

Tags: unreproducible

Merged with 2653

Done: Andrew Hyatt <ahyatt <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "William K. Foster" <wkf <at> alum.mit.edu>
To: bug-gnu-emacs <at> 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
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.