Skip to content

Commit

Permalink
Fixed issue #1641: Move getpid() syscall so it gets called less often…
Browse files Browse the repository at this point in the history
… when not remote debugging
  • Loading branch information
keeshoekzema authored and derickr committed Mar 8, 2019
1 parent 2912401 commit df17570
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions xdebug_com.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -485,16 +485,14 @@ int xdebug_is_debug_connection_active()


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

/* Start debugger if previously a connection was established and this /* Start debugger if previously a connection was established and this
* process no longer has the same PID */ * 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(); xdebug_restart_debugger();
} }


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


Expand Down

0 comments on commit df17570

Please sign in to comment.