Skip to content
Permalink
Browse files

Merged pull request #457

  • Loading branch information...
derickr committed Mar 8, 2019
2 parents 2912401 + df17570 commit 7967c18d84c6f422f0d185f5563e935616e818df
Showing with 2 additions and 4 deletions.
  1. +2 −4 xdebug_com.c
@@ -485,16 +485,14 @@ int xdebug_is_debug_connection_active()

int xdebug_is_debug_connection_active_for_current_pid()
{
long pid = getpid();

/* Start debugger if previously a connection was established and this
* process no longer has the same PID */
if ((xdebug_is_debug_connection_active() && (XG(remote_connection_pid) != pid))) {
if ((xdebug_is_debug_connection_active() && (XG(remote_connection_pid) != getpid()))) {
xdebug_restart_debugger();
}

return (
XG(remote_connection_enabled) && (XG(remote_connection_pid) == pid)
XG(remote_connection_enabled) && (XG(remote_connection_pid) == getpid())
);
}

1 comment on commit 7967c18

@jens1o

This comment has been minimized.

Copy link

jens1o commented on 7967c18 Mar 8, 2019

Is there no way we could (in the worst case) avoid the second getpid(maybe through a caching-function)?

Please sign in to comment.
You can’t perform that action at this time.