Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
06712765
Commit
06712765
authored
33 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Added finalization of opened streams.
parent
26657058
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/fd-stream.lisp
+14
-4
14 additions, 4 deletions
code/fd-stream.lisp
with
14 additions
and
4 deletions
code/fd-stream.lisp
+
14
−
4
View file @
06712765
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.1
6
1991/1
1
/0
9
0
2:47
:0
9
wlott Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.1
7
1991/1
2
/0
7
0
0:56
:0
4
wlott Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -983,6 +983,8 @@ non-server method is also significantly more efficient for large reads.
(
fd-stream-original
stream
)
stream
(
mach:get-unix-error-msg
err
)))))))
(
when
(
fboundp
'cancel-finalization
)
(
cancel-finalization
stream
))
(
mach:unix-close
(
fd-stream-fd
stream
))
(
when
(
fd-stream-obuf-sap
stream
)
(
push
(
fd-stream-obuf-sap
stream
)
*available-buffers*
)
...
...
@@ -1135,7 +1137,8 @@ non-server method is also significantly more efficient for large reads.
delete-original
(
name
(
if
file
(
format
nil
"file ~S"
file
)
(
format
nil
"descriptor ~D"
fd
))))
(
format
nil
"descriptor ~D"
fd
)))
auto-close
)
(
declare
(
type
index
fd
)
(
type
(
or
index
null
)
timeout
)
(
type
(
member
:none
:line
:full
)
buffering
))
"Create a stream for the given unix file descriptor.
...
...
@@ -1160,6 +1163,12 @@ non-server method is also significantly more efficient for large reads.
:buffering
buffering
:timeout
timeout
)))
(
set-routines
stream
element-type
input
output
)
(
when
(
and
auto-close
(
fboundp
'finalize
))
(
finalize
stream
#'
(
lambda
()
(
mach:unix-close
fd
)
(
format
*terminal-io*
"** Closed file descriptor ~D~%"
fd
))))
stream
))
;;; PICK-PACKUP-NAME -- internal
...
...
@@ -1352,7 +1361,8 @@ non-server method is also significantly more efficient for large reads.
:element-type
element-type
:file
namestring
:original
original
:delete-original
delete-original
))
:delete-original
delete-original
:auto-close
t
))
(
:probe
(
let
((
stream
(
%make-fd-stream
:name
namestring
:fd
fd
...
...
@@ -1434,7 +1444,7 @@ non-server method is also significantly more efficient for large reads.
(
if
tty
(
setf
*tty*
(
make-fd-stream
tty
:name
"the Terminal"
:input
t
:output
t
:buffering
:line
))
:buffering
:line
:auto-close
t
))
(
setf
*tty*
(
make-two-way-stream
*stdin*
*stdout*
))))
nil
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment