/* 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-2012 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
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 <unistd.h>
+# 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
+}