Fix system manager creation

This commit is contained in:
TakeV 2024-05-25 23:35:10 -04:00
parent 9eb5be1663
commit ee55ec59b5
Signed by: TakeV
GPG key ID: A64F41345C7400AF

View file

@ -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)