On restart, set the file port to unbuffered mode before seeking to

work around scsh limitiation.
This commit is contained in:
mainzelm 2004-02-10 12:27:57 +00:00
parent b7314f87f1
commit a65dbd70e4
1 changed files with 20 additions and 4 deletions

View File

@ -1089,8 +1089,16 @@
(lambda (restart-position) (lambda (restart-position)
(log (syslog-level debug) "clearing RESTART position") (log (syslog-level debug) "clearing RESTART position")
(set-the-session-restart-position! #f) (set-the-session-restart-position! #f)
(seek file-port restart-position) (if (not (zero? restart-position))
(log (syslog-level debug) "seeking for RESTART successful")))) (begin
;; scsh can seek on unbuffered ports only
(set-port-buffering file-port bufpol/none)
(seek file-port restart-position)
(log (syslog-level debug)
"seeking for RESTART at position ~A successful"
restart-position))
(log (syslog-level debug)
"Position is 0, no seek necessary")))))
(with-data-connection (with-data-connection
(lambda () (lambda ()
(case (the-session-type) (case (the-session-type)
@ -1151,8 +1159,16 @@
(lambda (restart-position) (lambda (restart-position)
(log (syslog-level debug) "clearing RESTART position") (log (syslog-level debug) "clearing RESTART position")
(set-the-session-restart-position! #f) (set-the-session-restart-position! #f)
(seek file-port restart-position) (if (not (zero? restart-position))
(log (syslog-level debug) "seeking for RESTART successful")))) (begin
;; scsh can seek on unbuffered ports only
(set-port-buffering file-port bufpol/none)
(seek file-port restart-position)
(log (syslog-level debug)
"seeking for RESTART at position ~A successful"
restart-position))
(log (syslog-level debug)
"Position is 0, no seek necessary")))))
(with-data-connection (with-data-connection
(lambda () (lambda ()
(let ((inport (socket:inport (the-session-data-socket)))) (let ((inport (socket:inport (the-session-data-socket))))