diff options
Diffstat (limited to 'otherlibs/unix')
-rw-r--r-- | otherlibs/unix/stat.c | 4 | ||||
-rw-r--r-- | otherlibs/unix/unix.ml | 7 |
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 |