summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1999-01-15 16:58:30 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1999-01-15 16:58:30 +0000
commitcae87c41f766baa20de6abb42e7aff79665141eb (patch)
treec1a52b718cdae2f9232c0bdc60a8ff1590b43b60 /otherlibs/unix
parent6e36d8910ac693e9729f352999bb960e30dc78f8 (diff)
Bug dans l'ordre des champs de Unix.stat
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2246 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix')
-rw-r--r--otherlibs/unix/stat.c4
-rw-r--r--otherlibs/unix/unix.ml7
2 files changed, 7 insertions, 4 deletions
diff --git a/otherlibs/unix/stat.c b/otherlibs/unix/stat.c
index 37e190ed4..6b69465c3 100644
--- a/otherlibs/unix/stat.c
+++ b/otherlibs/unix/stat.c
@@ -57,8 +57,8 @@ static value stat_aux(struct stat *buf)
Field (v, 7) = Val_int (buf->st_rdev);
Field (v, 8) = Val_int (buf->st_size);
Field (v, 9) = atime;
- Field (v, 10) = ctime;
- Field (v, 11) = mtime;
+ Field (v, 10) = mtime;
+ Field (v, 11) = ctime;
End_roots();
return v;
}
diff --git a/otherlibs/unix/unix.ml b/otherlibs/unix/unix.ml
index 85919c32b..060b904bb 100644
--- a/otherlibs/unix/unix.ml
+++ b/otherlibs/unix/unix.ml
@@ -624,8 +624,11 @@ let open_connection sockaddr =
match sockaddr with ADDR_UNIX _ -> PF_UNIX | ADDR_INET(_,_) -> PF_INET in
let sock =
socket domain SOCK_STREAM 0 in
- connect sock sockaddr;
- (in_channel_of_descr sock, out_channel_of_descr sock)
+ try
+ connect sock sockaddr;
+ (in_channel_of_descr sock, out_channel_of_descr sock)
+ with exn ->
+ close sock; raise exn
let shutdown_connection inchan =
shutdown (descr_of_in_channel inchan) SHUTDOWN_SEND