diff options
| author | Jim Blandy | 1993-03-20 21:07:59 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-03-20 21:07:59 +0000 |
| commit | a4fc73600689c581d66df71f2fae14f97fe42649 (patch) | |
| tree | bfb32220fdf842bae637e5ee6fc9c7e87d655f72 | |
| parent | 055e9517dce5dab1b119bad1a23543b30805adf5 (diff) | |
| download | emacs-a4fc73600689c581d66df71f2fae14f97fe42649.tar.gz emacs-a4fc73600689c581d66df71f2fae14f97fe42649.zip | |
* xterm.c (x_term_init): If the X connection is already in file
descriptor zero, don't dup it and close the old one.
| -rw-r--r-- | src/xterm.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c index 35bacb748cd..f766e129593 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -4557,17 +4557,20 @@ x_term_init (display_name) | |||
| 4557 | x_watch_cut_buffer_cache (); | 4557 | x_watch_cut_buffer_cache (); |
| 4558 | #endif | 4558 | #endif |
| 4559 | 4559 | ||
| 4560 | dup2 (ConnectionNumber (x_current_display), 0); | 4560 | if (ConnectionNumber (x_current_display) != 0) |
| 4561 | { | ||
| 4562 | dup2 (ConnectionNumber (x_current_display), 0); | ||
| 4561 | 4563 | ||
| 4562 | #ifndef SYSV_STREAMS | 4564 | #ifndef SYSV_STREAMS |
| 4563 | /* Streams somehow keeps track of which descriptor number | 4565 | /* Streams somehow keeps track of which descriptor number |
| 4564 | is being used to talk to X. So it is not safe to substitute | 4566 | is being used to talk to X. So it is not safe to substitute |
| 4565 | descriptor 0. But it is safe to make descriptor 0 a copy of it. */ | 4567 | descriptor 0. But it is safe to make descriptor 0 a copy of it. */ |
| 4566 | close (ConnectionNumber (x_current_display)); | 4568 | close (ConnectionNumber (x_current_display)); |
| 4567 | ConnectionNumber (x_current_display) = 0; /* Looks a little strange? | 4569 | ConnectionNumber (x_current_display) = 0; /* Looks a little strange? |
| 4568 | * check the def of the macro; | 4570 | * check the def of the macro; |
| 4569 | * it is a genuine lvalue */ | 4571 | * it is a genuine lvalue */ |
| 4570 | #endif /* SYSV_STREAMS */ | 4572 | #endif /* SYSV_STREAMS */ |
| 4573 | } | ||
| 4571 | 4574 | ||
| 4572 | #endif /* ! defined (HAVE_X11) */ | 4575 | #endif /* ! defined (HAVE_X11) */ |
| 4573 | 4576 | ||