Skip to content
Permalink
Browse files

Fixed issue #1641: Move getpid() syscall so it gets called less often…

… when not remote debugging
  • Loading branch information...
keeshoekzema authored and derickr committed Mar 8, 2019
1 parent 2912401 commit df17570fd52846baa7134f350547970644a8d1d5
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())
);
}

0 comments on commit df17570

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