Description: Fix FTBFS with OCaml 4.05.0 Author: Stephane Glondu Bug-Debian: https://bugs.debian.org/870150 Last-Update: 2017-08-01 --- sks-1.1.6.orig/eventloop.ml +++ sks-1.1.6/eventloop.ml @@ -26,6 +26,7 @@ open MoreLabels open Printf open Common open Packet +let unix_socket = Unix.socket module Unix = UnixLabels open Unix @@ -129,7 +130,7 @@ let create_sock addr = let domain = Unix.domain_of_sockaddr addr in let sock = - socket ~domain ~kind:SOCK_STREAM ~protocol:0 in + unix_socket domain SOCK_STREAM 0 in setsockopt sock SO_REUSEADDR true; if domain = PF_INET6 then setsockopt sock IPV6_ONLY true; --- sks-1.1.6.orig/reconComm.ml +++ sks-1.1.6/reconComm.ml @@ -26,6 +26,7 @@ open Printf open Common open Packet +let unix_socket = Unix.socket module Unix = UnixLabels module Map = PMap.Map @@ -37,10 +38,10 @@ open DbMessages (** send DbMessages message and wait for response *) let send_dbmsg msg = - let s = Unix.socket - ~domain:(Unix.domain_of_sockaddr db_command_addr) - ~kind:Unix.SOCK_STREAM - ~protocol:0 in + let s = unix_socket + (Unix.domain_of_sockaddr db_command_addr) + Unix.SOCK_STREAM + 0 in protect ~f:(fun () -> Unix.connect s ~addr:db_command_addr; let cin = Channel.sys_in_from_fd s in @@ -54,10 +55,10 @@ let send_dbmsg msg = (** send DbMessages message, don't wait for response *) let send_dbmsg_noreply msg = - let s = Unix.socket - ~domain:(Unix.domain_of_sockaddr db_command_addr) - ~kind:Unix.SOCK_STREAM - ~protocol:0 in + let s = unix_socket + (Unix.domain_of_sockaddr db_command_addr) + Unix.SOCK_STREAM + 0 in protect ~f:(fun () -> Unix.connect s ~addr:db_command_addr; let cout = Channel.sys_out_from_fd s in @@ -75,10 +76,10 @@ let is_content_type line = let http_status_ok_regexp = Str.regexp "^HTTP/[0-9]+\\.[0-9]+ 2" let get_keystrings_via_http addr hashes = - let s = Unix.socket - ~domain:(Unix.domain_of_sockaddr addr) - ~kind:Unix.SOCK_STREAM - ~protocol:0 in + let s = unix_socket + (Unix.domain_of_sockaddr addr) + Unix.SOCK_STREAM + 0 in protect ~f:(fun () -> Unix.bind s ~addr:(match_client_recon_addr addr); Unix.connect s ~addr; --- sks-1.1.6.orig/sks_do.ml +++ sks-1.1.6/sks_do.ml @@ -27,6 +27,7 @@ open Printf open Common open Packet open DbMessages +let unix_socket = Unix.socket module Unix = UnixLabels module PTree = PrefixTree module Map = PMap.Map @@ -37,10 +38,10 @@ let fail reason = exit (-1) let send_dbmsg msg = - let s = Unix.socket - ~domain:(Unix.domain_of_sockaddr db_command_addr) - ~kind:Unix.SOCK_STREAM - ~protocol:0 in + let s = unix_socket + (Unix.domain_of_sockaddr db_command_addr) + Unix.SOCK_STREAM + 0 in protect ~f:(fun () -> Unix.connect s ~addr:db_command_addr; let cin = Channel.sys_in_from_fd s in --- sks-1.1.6.orig/tester.ml +++ sks-1.1.6/tester.ml @@ -26,6 +26,7 @@ open Printf open Common open Packet open DbMessages +let unix_socket = Unix.socket module Unix = UnixLabels let settings = { @@ -46,10 +47,10 @@ module Keydb = Keydb.Safe let send_msg addr msg = - let s = Unix.socket - ~domain:(Unix.domain_of_sockaddr addr) - ~kind:Unix.SOCK_STREAM - ~protocol:0 in + let s = unix_socket + (Unix.domain_of_sockaddr addr) + Unix.SOCK_STREAM + 0 in protect ~f:( fun () -> Unix.connect s ~addr:addr; let cin = Channel.sys_in_from_fd s @@ -62,10 +63,10 @@ let send_msg addr msg = ~finally:(fun () -> Unix.close s) let send_msg_noreply addr msg = - let s = Unix.socket - ~domain:(Unix.domain_of_sockaddr addr) - ~kind:Unix.SOCK_STREAM - ~protocol:0 in + let s = unix_socket + (Unix.domain_of_sockaddr addr) + Unix.SOCK_STREAM + 0 in protect ~f:(fun () -> Unix.connect s ~addr:addr; let cout = Channel.sys_out_from_fd s in