]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
Remove signal handler debug stubs for FPE/SEGV from stdext as they are not needed...
authorAnil Madhavapeddy <anil@recoil.org>
Wed, 4 Nov 2009 20:55:18 +0000 (20:55 +0000)
committerAnil Madhavapeddy <anil@recoil.org>
Wed, 4 Nov 2009 20:55:18 +0000 (20:55 +0000)
Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
stdext/Makefile
stdext/sigutil.ml [deleted file]
stdext/sigutil.mli [deleted file]
stdext/sigutil_stub.c [deleted file]

index fd0edd60fd360f7b0f01ea9f0f9eee331ee6747e..fed4fd9096649651b069c0708c6b2f788a7ca9bc 100644 (file)
@@ -21,7 +21,7 @@ OCAML_TEST_LIB = $(shell ocamlfind query oUnit)/oUnit.cmxa
 
 STDEXT_OBJS = filenameext stringext arrayext hashtblext listext pervasiveext threadext ring \
        qring fring opt bigbuffer unixext range vIO trie config date encodings forkhelpers \
-       gzip sha1sum sigutil zerocheck base64 backtrace tar
+       gzip sha1sum zerocheck base64 backtrace tar
 
 INTF = $(foreach obj, $(STDEXT_OBJS),$(obj).cmi)
 LIBS = stdext.cma stdext.cmxa
@@ -45,10 +45,10 @@ stdext.cmxa: libstdext_stubs.a $(foreach obj,$(STDEXT_OBJS),$(obj).cmx)
 stdext.cma: $(foreach obj,$(STDEXT_OBJS),$(obj).cmo)
        $(OCAMLC) -a -dllib dllstdext_stubs.so -cclib -lstdext_stubs -o $@ $(foreach obj,$(STDEXT_OBJS),$(obj).cmo)
 
-stdext_stubs.a: unixext_stubs.o sigutil_stub.o zerocheck_stub.o 
+stdext_stubs.a: unixext_stubs.o zerocheck_stub.o 
        ocamlmklib -o stdext_stubs $+
 
-libstdext_stubs.a: unixext_stubs.o sigutil_stub.o zerocheck_stub.o 
+libstdext_stubs.a: unixext_stubs.o zerocheck_stub.o 
        ar rcs $@ $+
        ocamlmklib -o stdext_stubs $+
 
diff --git a/stdext/sigutil.ml b/stdext/sigutil.ml
deleted file mode 100644 (file)
index b766a08..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *)
-external install_fpe_handler : unit -> unit = "stub_install_fpe_handler"
-external install_segv_handler : unit -> unit = "stub_install_segv_handler"
diff --git a/stdext/sigutil.mli b/stdext/sigutil.mli
deleted file mode 100644 (file)
index b766a08..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *)
-external install_fpe_handler : unit -> unit = "stub_install_fpe_handler"
-external install_segv_handler : unit -> unit = "stub_install_segv_handler"
diff --git a/stdext/sigutil_stub.c b/stdext/sigutil_stub.c
deleted file mode 100644 (file)
index f5234f7..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-
-static void fpe_handler(int signum, siginfo_t *info, void *ptr)
-{
-       FILE *file;
-       if (signum != SIGFPE || info == NULL)
-               return;
-       file = fopen("/tmp/fpe_dump", "w+");
-       if (file == NULL)
-               return;
-
-       fprintf(file, "si_signo: %d\n", info->si_signo);
-       fprintf(file, "si_errno: %d\n", info->si_errno);
-       fprintf(file, "si_code: %d\n", info->si_code);
-       fprintf(file, "si_pid: %d\n", info->si_pid);
-       fprintf(file, "si_status: %d\n", info->si_status);
-       fprintf(file, "si_value: %d\n", info->si_value);
-       fprintf(file, "si_int: %lx\n", info->si_int);
-       fprintf(file, "si_ptr: %lx\n", (unsigned long) info->si_ptr);
-       fprintf(file, "si_addr: %lx\n", (unsigned long) info->si_addr);
-       fprintf(file, "uarg: %lx\n", (unsigned long) ptr);
-       fclose(file);
-
-       kill(0, SIGFPE);
-}
-
-static void segv_handler(int signum, siginfo_t *info, void *ptr)
-{
-       FILE *file;
-       if (signum != SIGSEGV || info == NULL)
-               return;
-       file = fopen("/tmp/segv_dump", "w+");
-       if (file == NULL)
-               return;
-
-       fprintf(file, "si_signo: %d\n", info->si_signo);
-       fprintf(file, "si_errno: %d\n", info->si_errno);
-       fprintf(file, "si_code: %d\n", info->si_code);
-       fprintf(file, "si_pid: %d\n", info->si_pid);
-       fprintf(file, "si_status: %d\n", info->si_status);
-       fprintf(file, "si_value: %d\n", info->si_value);
-       fprintf(file, "si_int: %lx\n", info->si_int);
-       fprintf(file, "si_ptr: %lx\n", (unsigned long) info->si_ptr);
-       fprintf(file, "si_addr: %lx\n", (unsigned long) info->si_addr);
-       fprintf(file, "uarg: %lx\n", (unsigned long) ptr);
-       fclose(file);
-
-       kill(0, SIGSEGV);
-}
-
-#define CAML_NAME_SPACE
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/signals.h>
-#include <caml/fail.h>
-
-CAMLprim value stub_install_fpe_handler(value unit)
-{
-       CAMLparam1(unit);
-       struct sigaction act;
-
-       act.sa_sigaction = fpe_handler;
-       act.sa_flags = SA_SIGINFO | SA_RESETHAND;
-
-       sigaction(SIGFPE, &act, NULL);
-
-       CAMLreturn(Val_unit);
-}
-
-CAMLprim value stub_install_segv_handler(value unit)
-{
-       CAMLparam1(unit);
-       struct sigaction act;
-       act.sa_sigaction = segv_handler;
-       act.sa_flags = SA_SIGINFO | SA_RESETHAND;
-
-       sigaction(SIGSEGV, &act, NULL);
-
-       CAMLreturn(Val_unit);
-}