Fix system manager creation
This commit is contained in:
parent
9eb5be1663
commit
ee55ec59b5
1 changed files with 15 additions and 14 deletions
|
@ -38,26 +38,27 @@
|
|||
(define (add-system-to-system-manager sys-manager sys)
|
||||
"Returns a new system manager with sys added,
|
||||
or false if the input is invalid."
|
||||
(let ((proc-table (system-manager-proc-table sys-manager))
|
||||
(old-systems (systems sys-manager)))
|
||||
(if (and (system-manager? sys-manager)
|
||||
(system? sys))
|
||||
(make-system-manager (cons sys old-systems)
|
||||
proc-table)
|
||||
(error "Invalid inputs to add-system-to-system-manager"
|
||||
sys-manager sys))))
|
||||
(let ((proc-table (system-manager-proc-table sys-manager))
|
||||
(old-systems (systems sys-manager)))
|
||||
(make-system-manager (cons sys old-systems) proc-table))
|
||||
(error "Invalid inputs to add-system-to-system-manager" sys-manager sys)))
|
||||
|
||||
(define create-system-manager
|
||||
(case-lambda
|
||||
(()
|
||||
(make-system-manager '() (make-eq-hashtable)))
|
||||
((sys-list)
|
||||
(cond
|
||||
((list? sys-list)
|
||||
(fold (lambda (manager sys)
|
||||
(if (system? sys)
|
||||
(add-system-to-system-manager manager sys)
|
||||
manager))
|
||||
(when (system? sys)
|
||||
(add-system-to-system-manager manager sys)))
|
||||
(create-system-manager)
|
||||
sys-list))))
|
||||
sys-list))
|
||||
(else (error "Incorrect parameter passed to create-system-manager"
|
||||
sys-list))))))
|
||||
|
||||
(define (get-procs-from-table sys-manager entity)
|
||||
(if (and (system-manager? sys-manager)
|
||||
|
|
Loading…
Reference in a new issue