Skip to content

Commit

Permalink
used it
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Applencourt committed Oct 1, 2024
1 parent bcda3e1 commit 563ad24
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xprof/xprof.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ PREFIX = '@prefix@'
DATAROOTDIR = File.join(PREFIX, 'share')
DATADIR = DATAROOTDIR

$EXIT_CODE_USER_BINARY = 0

$LOAD_PATH.unshift(DATADIR) if File.directory?(DATADIR)
require 'open3'
require 'fileutils'
Expand Down Expand Up @@ -428,11 +430,11 @@ def launch_usr_bin(env, cmd)
rescue Errno::EIO
# Wait for the PTY to finish, to set $?
Process.wait(_pid)
$?
return $?.exitstatus
end
rescue Interrupt
LOGGER.warn { 'Application Received Interrupt Signal' }
#SigINT is 2
# SigINT is 2
2
rescue Errno::ENOENT
warn("#{__FILE__}: Can't find executable #{cmd.first}")
Expand Down Expand Up @@ -685,7 +687,7 @@ def trace_and_on_node_processing(usr_argv)

# Launch User Command
begin
launch_usr_bin(h, usr_argv)
$EXIT_CODE_USER_BINARY = launch_usr_bin(h, usr_argv)
rescue Errno::ENOENT
teardown_lttng(syncd)
raise
Expand Down Expand Up @@ -742,7 +744,7 @@ def gm_processing(folder)

fo.close
end
exit(1) unless $?.success?
exit($?.success? ? $EXIT_CODE_USER_BINARY : $?.exitstatus)
end

#
Expand Down

0 comments on commit 563ad24

Please sign in to comment.