components/ocaml/patches/ocaml-solaris-build.patch
author Brian Cameron <brian.cameron@oracle.com>
Wed, 21 Aug 2013 14:33:32 -0700
changeset 1450 02791a89ea4f
permissions -rw-r--r--
17262870 Migrate ocaml to Userland
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1450
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     1
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     2
Patch from Desktop team that fixes a NFS issue.
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     3
http://caml.inria.fr/mantis/view.php?id=4663
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     4
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     5
diff -urN ocaml-3.11.2/byterun/io.c ocaml-3.11.2.new/byterun/io.c
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     6
--- ocaml-3.11.2/byterun/io.c	2011-04-07 13:41:41.040436216 +0800
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     7
+++ ocaml-3.11.2.new/byterun/io.c	2011-04-07 13:42:50.119747390 +0800
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     8
@@ -479,6 +479,9 @@
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
     9
   struct channel * channel = Channel(vchannel);
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    10
   if (channel->fd != -1){
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    11
     result = close(channel->fd);
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    12
+    /* Work around an NFS issue that causes close() to fails with EINVAL */
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    13
+    if ((result < 0) && (errno == EINVAL))
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    14
+      result = 0;
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    15
     channel->fd = -1;
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    16
   }else{
02791a89ea4f 17262870 Migrate ocaml to Userland
Brian Cameron <brian.cameron@oracle.com>
parents:
diff changeset
    17
     result = 0;