Changeset 146703 for trunk/base


Ignore:
Timestamp:
Mar 15, 2016, 4:07:20 PM (4 years ago)
Author:
cal@…
Message:

base: macports1.0: Avoid trace when C-ing reclaim

Signals in reclaim code could cause the error to bubble up into the Tcl
interpreter. To avoid a stacktrace being printed, catch the error and return an
error code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/macports.tcl

    r146677 r146703  
    44794479
    44804480proc macports::reclaim_main {} {
    4481 
    44824481    # Calls the main function for the 'port reclaim' command.
    44834482    #
     
    44874486    #           None
    44884487
    4489     reclaim::main
     4488    try {
     4489        reclaim::main
     4490    } catch {{POSIX SIG SIGINT} eCode eMessage} {
     4491        ui_error [msgcat::mc "reclaim aborted: SIGINT received."]
     4492        return 2
     4493    } catch {{POSIX SIG SIGTERM} eCode eMessage} {
     4494        ui_error [msgcat::mc "reclaim aborted: SIGTERM received."]
     4495        return 2
     4496    } catch {{*} eCode eMessage} {
     4497        ui_debug "reclaim failed: $::errorInfo"
     4498        ui_error [msgcat::mc "reclaim failed: %s" $eMessage]
     4499        return 1
     4500    }
    44904501    return 0
    44914502}
Note: See TracChangeset for help on using the changeset viewer.