all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#2602: Emacs shell exits when executed command sets stdout and stderr to be non-blocking
@ 2009-03-08 20:56 William K. Foster
  2016-01-24 22:03 ` Andrew Hyatt
  0 siblings, 1 reply; 2+ messages in thread
From: William K. Foster @ 2009-03-08 20:56 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#2602: Emacs shell exits when executed command sets stdout and stderr to be non-blocking
  2009-03-08 20:56 bug#2602: Emacs shell exits when executed command sets stdout and stderr to be non-blocking William K. Foster
@ 2016-01-24 22:03 ` Andrew Hyatt
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Hyatt @ 2016-01-24 22:03 UTC (permalink / raw)
  To: William K. Foster; +Cc: 2602


I cannot reproduce this on Emacs 25.  Can you let me know if you are
still able to see this bug, otherwise I'll close this issue.

"William K. Foster" <wkf@alum.mit.edu> writes:

> 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-24 22:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-08 20:56 bug#2602: Emacs shell exits when executed command sets stdout and stderr to be non-blocking William K. Foster
2016-01-24 22:03 ` Andrew Hyatt

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.