From 89d876d0f7408ff2b067acdc0393683741776292 Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 31 Jul 2006 06:59:41 +1000 Subject: [PATCH] Provide fallback of killpg function darcs-hash:20060730205941-ac50b-ddcec32cc5ab74770b743fed3d131460ee576191.gz --- configure.ac | 2 +- fallback.c | 8 ++++++++ fallback.h | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4c2adcc66..f957ce5ad 100644 --- a/configure.ac +++ b/configure.ac @@ -259,7 +259,7 @@ AC_CHECK_HEADER([regex.h], # Check for presense of various functions AC_CHECK_FUNCS( gettext wcsdup wcsndup wcslen wcscasecmp wcsncasecmp fwprintf ) AC_CHECK_FUNCS( futimes wcwidth wcswidth getopt_long wcstok fputwc fgetwc ) -AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy lrand48_r) +AC_CHECK_FUNCS( wcstol dcgettext wcslcat wcslcpy lrand48_r killpg) # The Makefile also needs to know if we have gettext, so it knows if the translations should be installed. AC_CHECK_FUNC( gettext, AC_SUBST( HAVE_GETTEXT, 1 ), AC_SUBST( HAVE_GETTEXT, 0 ) ) diff --git a/fallback.c b/fallback.c index 3167f4608..41f5a886f 100644 --- a/fallback.c +++ b/fallback.c @@ -25,6 +25,7 @@ #include #include #include +#include #if HAVE_NCURSES_H #include @@ -1076,3 +1077,10 @@ int _nl_msg_cat_cntr=0; #endif +#ifndef HAVE_KILLPG +int killpg( int pgr, int sig ) +{ + assert( pgr > 0 ); + return kill( -pgr, sig ); +} +#endif diff --git a/fallback.h b/fallback.h index d9a119a82..c87145a18 100644 --- a/fallback.h +++ b/fallback.h @@ -376,5 +376,10 @@ extern int _nl_msg_cat_cntr; #endif + +#ifndef HAVE_KILLPG +int killpg( int pgr, int sig ); +#endif + #endif