Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
120
Issues
120
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
05a32c4c
Commit
05a32c4c
authored
Jun 22, 2017
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protect unix error, another attempt
parent
100fc224
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
13 deletions
+23
-13
src/driver/prove_client.ml
src/driver/prove_client.ml
+23
-13
No files found.
src/driver/prove_client.ml
View file @
05a32c4c
...
...
@@ -19,31 +19,41 @@ let is_connected () = !socket <> None
let
client_connect
socket_name
=
if
!
socket
<>
None
then
raise
AlreadyConnected
;
try
if
Sys
.
os_type
=
"Win32"
then
raise
Exit
;
let
sock
=
Unix
.
socket
Unix
.
PF_UNIX
Unix
.
SOCK_STREAM
0
in
if
Sys
.
os_type
=
"Win32"
then
let
name
=
"
\\\\
.
\\
pipe
\\
"
^
socket_name
in
try
Unix
.
connect
sock
(
Unix
.
ADDR_UNIX
socket_name
);
let
sock
=
Unix
.
openfile
name
[
Unix
.
O_RDWR
]
0
in
socket
:=
Some
sock
with
|
Unix
.
Unix_error
(
err
,
func
,
arg
)
->
Format
.
eprintf
"socket connection failed: %s (%s,%s)@."
(
Unix
.
error_message
err
)
func
arg
;
Format
.
eprintf
"falling back to a named socket@."
;
raise
Exit
Format
.
eprintf
"opening named socket failed: %s (%s,%s)@."
(
Unix
.
error_message
err
)
func
arg
;
|
e
->
Format
.
eprintf
"Unix.
connect
failed for some unexpected reason: %s@
\n
Aborting.@."
Format
.
eprintf
"Unix.
openfile
failed for some unexpected reason: %s@
\n
Aborting.@."
(
Printexc
.
to_string
e
);
exit
2
with
Exit
->
else
let
sock
=
Unix
.
socket
Unix
.
PF_UNIX
Unix
.
SOCK_STREAM
0
in
try
let
name
=
"
\\\\
.
\\
pipe
\\
"
^
socket_name
in
let
sock
=
Unix
.
openfile
name
[
Unix
.
O_RDWR
]
0
in
Unix
.
connect
sock
(
Unix
.
ADDR_UNIX
socket_name
);
socket
:=
Some
sock
with
|
Unix
.
Unix_error
(
err
,
func
,
arg
)
->
Format
.
eprintf
"opening named socket failed: %s (%s,%s)@."
(
Unix
.
error_message
err
)
func
arg
;
Format
.
eprintf
"socket connection failed: %s (%s,%s) (socket_name=%s)@."
(
Unix
.
error_message
err
)
func
arg
socket_name
;
Format
.
eprintf
"falling back to a named socket@."
;
let
name
=
Filename
.
temp_file
"why3"
socket_name
in
begin
try
let
sock
=
Unix
.
openfile
name
[
Unix
.
O_RDWR
]
0
in
socket
:=
Some
sock
with
|
Unix
.
Unix_error
(
err
,
func
,
arg
)
->
Format
.
eprintf
"opening named socket failed: %s (%s,%s)@."
(
Unix
.
error_message
err
)
func
arg
;
|
e
->
Format
.
eprintf
"Unix.openfile failed for some unexpected reason: %s@
\n
Aborting.@."
(
Printexc
.
to_string
e
);
exit
2
end
|
e
->
Format
.
eprintf
"Unix.
openfile
failed for some unexpected reason: %s@
\n
Aborting.@."
Format
.
eprintf
"Unix.
connect
failed for some unexpected reason: %s@
\n
Aborting.@."
(
Printexc
.
to_string
e
);
exit
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment