X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fraise.c;h=cf58a7e955913ba9be5d0569dc0abb0ba43170cb;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=980c9fd488c11f6a5ac031658b2059315bd7a516;hpb=492fd301bd2018288330c0a20a086b1a8cc611ce;p=gnulib.git diff --git a/lib/raise.c b/lib/raise.c index 980c9fd48..cf58a7e95 100644 --- a/lib/raise.c +++ b/lib/raise.c @@ -1,6 +1,6 @@ /* Provide a non-threads replacement for the POSIX raise function. - Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006, 2009-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ # undef raise # if HAVE_MSVC_INVALID_PARAMETER_HANDLER -static inline int +static int raise_nothrow (int sig) { int result; @@ -50,24 +50,30 @@ raise_nothrow (int sig) return result; } -# define raise raise_nothrow +# else +# define raise_nothrow raise # endif -int -rpl_raise (int sig) -{ - return raise_nothrow (sig); -} - #else /* An old Unix platform. */ # include +# define rpl_raise raise + +#endif + int -raise (int sig) +rpl_raise (int sig) { - return kill (getpid (), sig); -} +#if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE + if (sig == SIGPIPE) + return _gl_raise_SIGPIPE (); +#endif +#if HAVE_RAISE + return raise_nothrow (sig); +#else + return kill (getpid (), sig); #endif +}