Hi,

After enabling the testsuite execution when building Debian packages I
noticed that the testsuite fails on Debian/Hurd. Every testcase was
failing with Unix_error exception, because while Hurd has getitimer
function, it just returns ENOSYS error there.

The attached patch detects whether the system has working getitimer
function, and if not, makes coccinelle use alarm() API instead.

With this patch coccinelle builds fine on all Debian architectures with
386 successful test cases (expected: 377).

Regards,
Eugeniy Meshcheryakov
--- a/commons/common.ml
+++ b/commons/common.ml
@@ -3529,7 +3529,11 @@
  * question: can we have a signal and so exn when in a exn handler ?
  *)
 
-let interval_timer = ref true
+let interval_timer = ref (
+  try
+    ignore(Unix.getitimer Unix.ITIMER_VIRTUAL);
+    true
+  with Unix.Unix_error(_, _, _) -> false)
 
 let timeout_function timeoutval = fun f ->
   try

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to