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
fcdb9db6
Commit
fcdb9db6
authored
34 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Added a retry case to the permision denied error in open.
parent
2356d142
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/fd-stream.lisp
+49
-42
49 additions, 42 deletions
code/fd-stream.lisp
with
49 additions
and
42 deletions
code/fd-stream.lisp
+
49
−
42
View file @
fcdb9db6
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC).
;;; **********************************************************************
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.
8
199
0/1
1/
0
3 00:
26:39
wlott Exp $
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.
9
199
1/0
1/
1
3 00:
52:08
wlott Exp $
;;;
;;; Streams for UNIX file descriptors.
;;;
...
...
@@ -1170,50 +1170,57 @@
(
setf
if-exists
:supersede
))))
;; Okay, now we can try the actual open.
(
multiple-value-bind
(
fd
errno
)
(
mach:unix-open
namestring
mask
mode
)
(
cond
((
numberp
fd
)
(
case
direction
((
:input
:output
:io
)
(
make-fd-stream
fd
:input
input
:output
output
:element-type
element-type
:file
namestring
:original
original
:delete-original
delete-original
))
(
:probe
(
let
((
stream
(
%make-fd-stream
:name
namestring
:fd
fd
:element-type
element-type
)))
(
close
stream
)
stream
))))
((
eql
errno
mach:enoent
)
(
case
if-does-not-exist
(
:error
(
cerror
"Return NIL."
"Error opening ~S, ~A."
pathname
(
mach:get-unix-error-msg
errno
)))
(
:create
(
cerror
"Return NIL."
"Error creating ~S, path does not exist."
pathname
)))
nil
)
((
eql
errno
mach:eexist
)
(
unless
(
eq
nil
if-exists
)
(
loop
(
multiple-value-bind
(
fd
errno
)
(
mach:unix-open
namestring
mask
mode
)
(
cond
((
numberp
fd
)
(
return
(
case
direction
((
:input
:output
:io
)
(
make-fd-stream
fd
:input
input
:output
output
:element-type
element-type
:file
namestring
:original
original
:delete-original
delete-original
))
(
:probe
(
let
((
stream
(
%make-fd-stream
:name
namestring
:fd
fd
:element-type
element-type
)))
(
close
stream
)
stream
)))))
((
eql
errno
mach:enoent
)
(
case
if-does-not-exist
(
:error
(
cerror
"Return NIL."
"Error opening ~S, ~A."
pathname
(
mach:get-unix-error-msg
errno
)))
(
:create
(
cerror
"Return NIL."
"Error creating ~S, path does not exist."
pathname
)))
(
return
nil
))
((
eql
errno
mach:eexist
)
(
unless
(
eq
nil
if-exists
)
(
cerror
"Return NIL."
"Error opening ~S, ~A."
pathname
(
mach:get-unix-error-msg
errno
)))
(
return
nil
))
((
eql
errno
mach:eacces
)
(
cerror
"Try again."
"Error opening ~S, ~A."
pathname
(
mach:get-unix-error-msg
errno
)))
(
t
(
cerror
"Return NIL."
"Error opening ~S, ~A."
pathname
(
mach:get-unix-error-msg
errno
)))
nil
)
(
t
(
cerror
"Return NIL."
"Error opening ~S, ~A."
pathname
(
mach:get-unix-error-msg
errno
))
nil
)))))))
(
mach:get-unix-error-msg
errno
))
(
return
nil
)))))))))
;;;; Initialization.
...
...
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