system: dont let any errors interfere with the shutdown process and just
ignore them Conflicts: core/system/system.factordb4
parent
4e63ba8dc8
commit
f32131698a
|
@ -1,4 +1,4 @@
|
|||
USING: classes.singleton help.markup help.syntax kernel math ;
|
||||
USING: classes.singleton help.markup help.syntax init kernel math ;
|
||||
IN: system
|
||||
|
||||
ABOUT: "system"
|
||||
|
@ -65,7 +65,7 @@ HELP: embedded?
|
|||
|
||||
HELP: exit
|
||||
{ $values { "n" "an integer exit code" } }
|
||||
{ $description "Exits the Factor process." } ;
|
||||
{ $description "Runs all " { $link shutdown-hooks } " and then exits the Factor process. If an error occurs when the shutdown hooks runs, or when the process is about to terminate, the error is ignored and the process exits with status 255." } ;
|
||||
|
||||
HELP: nano-count
|
||||
{ $values { "ns" integer } }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! Copyright (C) 2007, 2010 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: assocs init kernel kernel.private make namespaces sequences strings ;
|
||||
USING: assocs continuations init io kernel kernel.private make
|
||||
namespaces sequences ;
|
||||
IN: system
|
||||
|
||||
SINGLETONS: x86.32 x86.64 arm ppc.32 ppc.64 ;
|
||||
|
@ -61,9 +62,9 @@ PRIVATE>
|
|||
|
||||
: vm ( -- path ) \ vm get-global ;
|
||||
|
||||
: embedded? ( -- ? ) OBJ-EMBEDDED special-object ;
|
||||
: install-prefix ( -- path ) \ install-prefix get-global ;
|
||||
|
||||
: exit ( n -- * ) do-shutdown-hooks (exit) ;
|
||||
: embedded? ( -- ? ) OBJ-EMBEDDED special-object ;
|
||||
|
||||
: version-info ( -- str )
|
||||
! formatting vocab not available in this context.
|
||||
|
@ -72,3 +73,8 @@ PRIVATE>
|
|||
vm-compile-time % ") [" %
|
||||
vm-compiler % " " % cpu cpu>string % "] on " % os os>string %
|
||||
] "" make ;
|
||||
|
||||
: exit ( n -- * )
|
||||
[ do-shutdown-hooks (exit) ] ignore-errors
|
||||
[ "Unexpected error during shutdown!" print ] ignore-errors
|
||||
255 (exit) ;
|
||||
|
|
Loading…
Reference in New Issue