;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Private patches made by keith
;;; Reason:
;;;  test set-sys-host fix
;;; Reason:
;;;  If you used si:set-sys-host, but didn't specify the primary name 
;;;  of the remote host exactly, you could get into a nasty mess where
;;;  there are two non-EQ occurrences of the sys host's physical host
;;;  object -- on on si:host-alist, the other on fs:*pathname-host-list*.
;;;  Symptoms: you can't connect to the sys host - invalid chaos address
;;;  errors, LOS on open connections, etc.  Brutal.
;;;  
;;;  This is a drastic way to fix this: after loading site info, remove
;;;  any network host computers from *pathname-host-list*, except for
;;;  si:local-host and the fs:local-file-host object (LM:).  They
;;;  might come in handy, and shouldn't be a problem.
;;; Written 6-Jan-88 18:27:53 by keith (Keith Corbett) at site LMI
;;; while running on Opus from band 1
;;; with Experimental System 123.174, Experimental Local-File 73.3, Experimental FILE-Server 22.1, Experimental Unix-Interface 11.0, Experimental Tape 18.0, Experimental KERMIT 34.3, Experimental ZMail 71.0, Experimental Lambda-Diag 15.0, Experimental Tiger 27.0, Experimental Site Data Editor 8.4, Experimental Laser1+ 2.0, microcode 1754, SDU Boot Tape 3.14, SDU ROM 8, Beta I/site/dvi.



; From modified file OPUS: L.NETWORK; HOST.LISP#157 at 6-Jan-88 18:28:13
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "OPUS: L.NETWORK; HOST.#"


(defun remove-file-computers-from-pathname-list()
  (setq fs:*pathname-host-list*
	(remove-if #'(lambda(host)
		       (and (typep host 'si:host)
			    (not (typep host 'fs:local-file-host))
			    (not eq host si:local-host)))
		   fs:*pathname-host-list*)))

))

; From modified file OPUS: L.NETWORK; HOST.LISP#157 at 6-Jan-88 18:28:15
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "OPUS: L.NETWORK; HOST.#"


(add-initialization "Remove file computers from pathname list"
		    '(remove-file-computers-from-pathname-list)
		    '(site normal))

))

; From modified file OPUS: L.NETWORK; HOST.LISP#157 at 6-Jan-88 18:34:54
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "OPUS: L.NETWORK; HOST.#"


(defun remove-file-computers-from-pathname-list()
  (setq fs:*pathname-host-list*
	(remove-if #'(lambda(host)
		       (and (typep host 'si:host)
			    (not (typep host 'fs:local-file-host))
			    (not (eq host si:local-host))))
		   fs:*pathname-host-list*)))

(add-initialization "Remove file computers from pathname list"
		    '(remove-file-computers-from-pathname-list)
		    '(site normal))

))
