;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Patch file for System version 123.171
;;; Reason:
;;;  Fix to (open "sdu-serial-b:" ...) [shared-device support for serial ports]:
;;;  When we add :flavor-and-init-options to (open), we really want them to happen.
;;;  Do this before open by replacing the "last instance" with an instance with the
;;;  desired flavor and init options.
;;;  Yes, this seems like a hard way to do something simple, but given the way
;;;  the shared devices work -- they only replace the last-instance if the flavor
;;;  type has changed -- this seems the best and most localized place to do this.
;;; Written 4-Jan-88 12:52:06 by keith at site Gigamos Cambridge
;;; while running on Jack Flanders from band 2
;;; with Experimental System 123.168, 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, microcode 1754, SDU Boot Tape 3.12, SDU ROM 8.



; From modified file DJ: L.SYS; SHARED-DEVICE.LISP#49 at 4-Jan-88 12:52:07
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: SYS; SHARED-DEVICE  "

(defmethod (sdu-serial-b-shared-device :before :open) (flavor-and-init-options shared-device-pathname)
  (let ((flavor (car flavor-and-init-options))
	(init-options (cdr flavor-and-init-options)))
    (when init-options
      (setf (getf init-options :shared-device) shared-device-pathname)
      (setq last-instance (apply 'make-instance flavor init-options)))))

))
