-ocaml-parmap-handle-racing-mkdirs.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-parmap?expand=0&rev=10
This commit is contained in:
Olaf Hering 2016-06-16 22:17:41 +00:00 committed by Git OBS Bridge
parent 151d6279a4
commit 0f5095e8b1
3 changed files with 2 additions and 26 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f62d7afc40a5d15fa7695ca3a332736895432e468f64ae81bb05e394b076975f
size 62440
oid sha256:c05a18b65865726e6a656938a385f40e635392c1ea08f30bbcf94c190bb72518
size 62428

View File

@ -1,23 +0,0 @@
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

@ -2,7 +2,6 @@
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