Accepting request 401778 from home:jeff_mahoney:branches:devel:languages:ocaml

Fix racing mkdirs

OBS-URL: https://build.opensuse.org/request/show/401778
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-parmap?expand=0&rev=8
This commit is contained in:
Olaf Hering 2016-06-13 22:11:22 +00:00 committed by Git OBS Bridge
parent cc3fa3be52
commit ecc4cee8e6
5 changed files with 37 additions and 4 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea3cb7d961cd976eda8eb85d73dbd8315c9b1a483fb4b6f18b0bef6b2f0ee542
size 62384
oid sha256:999c1b3e0cd84c365bc99a533f4cc1f997ca9a9f388231810fa010c6f117eb1f
size 62372

View File

@ -20,10 +20,11 @@ Version: 20160512.7598fb9
%{ocaml_preserve_bytecode}
Release: 0
License: LGPL-2.0
Summary: Eploit multicore architectures for OCaml programs with minimal modifications
Summary: Exploit multicore architectures for OCaml programs with minimal modifications
Url: http://rdicosmo.github.io/parmap/
Group: Development/Libraries/Other
Source: %{name}-%{version}.tar.xz
Patch: ocaml-parmap-handle-racing-mkdirs.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: ocaml
@ -62,6 +63,7 @@ developing applications that use %{name}.
%prep
%setup -q
%patch -p1
%build
autoreconf -fi -I m4

View File

@ -0,0 +1,23 @@
diff --git a/parmap.ml b/parmap.ml
index f781d96..c0954fd 100644
--- a/parmap.ml
+++ b/parmap.ml
@@ -42,10 +42,14 @@ let can_redirect path =
try
Unix.mkdir path 0o777; true
with Unix.Unix_error(e,_s,_s') ->
- (Printf.eprintf "[Pid %d]: Error creating %s : %s; proceeding without \
- stdout/stderr redirection\n%!"
- (Unix.getpid ()) path (Unix.error_message e));
- false
+ (* another job may have created it between the check and the mkdir *)
+ if e == Unix.EEXIST then true
+ else begin
+ (Printf.eprintf "[Pid %d]: Error creating %s : %s; proceeding \
+ without stdout/stderr redirection\n%!"
+ (Unix.getpid ()) path (Unix.error_message e));
+ false
+ end
else true
let log_debug fmt =

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Jun 4 19:52:34 UTC 2016 - jeffm@suse.com
- Handle racing mkdirs
- Added patch: ocaml-parmap-handle-racing-mkdirs.patch
-------------------------------------------------------------------
Tue May 24 12:01:41 UTC 2016 - olaf@aepfle.de

View File

@ -20,10 +20,11 @@ Version: 0
%{ocaml_preserve_bytecode}
Release: 0
License: LGPL-2.0
Summary: Eploit multicore architectures for OCaml programs with minimal modifications
Summary: Exploit multicore architectures for OCaml programs with minimal modifications
Url: http://rdicosmo.github.io/parmap/
Group: Development/Libraries/Other
Source: %{name}-%{version}.tar.xz
Patch: ocaml-parmap-handle-racing-mkdirs.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: ocaml
@ -62,6 +63,7 @@ developing applications that use %{name}.
%prep
%setup -q
%patch -p1
%build
autoreconf -fi -I m4