git://git.jankratochvil.net
/
gdbmicli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1108729
)
Fix stale gdbs on gdbmicli abort.
author
Jan Kratochvil
<jan.kratochvil@redhat.com>
Sat, 11 Aug 2012 07:40:54 +0000
(09:40 +0200)
committer
Jan Kratochvil
<jan.kratochvil@redhat.com>
Sat, 11 Aug 2012 07:40:54 +0000
(09:40 +0200)
libmigdb/src/connect.c
patch
|
blob
|
history
diff --git
a/libmigdb/src/connect.c
b/libmigdb/src/connect.c
index
e9f26b7
..
eb54b5e
100644
(file)
--- a/
libmigdb/src/connect.c
+++ b/
libmigdb/src/connect.c
@@
-408,19
+408,25
@@
mi_h *mi_connect_local()
{/* We are the child. */
char *argv[5];
/* Connect stdin/out to the pipes. */
{/* We are the child. */
char *argv[5];
/* Connect stdin/out to the pipes. */
+ close(h->to_gdb[1]);
+ close(h->from_gdb[0]);
dup2(h->to_gdb[0],STDIN_FILENO);
dup2(h->to_gdb[0],STDIN_FILENO);
+ close(h->to_gdb[0]);
dup2(h->from_gdb[1],STDOUT_FILENO);
dup2(h->from_gdb[1],STDOUT_FILENO);
+ close(h->from_gdb[1]);
/* Pass the control to gdb. */
argv[0]=(char *)gdb; /* Is that OK? */
argv[1]="--interpreter=mi";
argv[2]="--quiet";
argv[3]=disable_psym_search_workaround ? 0 : "--readnow";
argv[4]=0;
/* Pass the control to gdb. */
argv[0]=(char *)gdb; /* Is that OK? */
argv[1]="--interpreter=mi";
argv[2]="--quiet";
argv[3]=disable_psym_search_workaround ? 0 : "--readnow";
argv[4]=0;
- execvp(
argv[0],
mi_gdb_argv ? mi_gdb_argv : argv);
+ execvp(
mi_gdb_argv ? mi_gdb_argv[0] : argv[0],
mi_gdb_argv ? mi_gdb_argv : argv);
/* We get here only if exec failed. */
_exit(127);
}
/* We are the parent. */
/* We get here only if exec failed. */
_exit(127);
}
/* We are the parent. */
+ close(h->to_gdb[0]);
+ close(h->from_gdb[1]);
if (h->pid==-1)
{/* Fork failed. */
mi_error=MI_FORK;
if (h->pid==-1)
{/* Fork failed. */
mi_error=MI_FORK;