Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc92cca

Browse files
committed
Drop support for getting signal descriptions from sys_siglist[].
It appears that all platforms that have sys_siglist[] also havestrsignal(), making that fallback case in pg_strsignal() dead code.Getting rid of it allows dropping a configure test, which seems worthmore than providing textual signal descriptions on whatever platformsmight still hypothetically have use for the fallback case.Discussion:https://postgr.es/m/25758.1544983503@sss.pgh.pa.us
1 parentca41030 commitcc92cca

File tree

4 files changed

+9
-42
lines changed

4 files changed

+9
-42
lines changed

‎configure

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16064,24 +16064,6 @@ esac
1606416064

1606516065
fi
1606616066

16067-
ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
16068-
/* NetBSD declares sys_siglist in unistd.h. */
16069-
#ifdef HAVE_UNISTD_H
16070-
# include <unistd.h>
16071-
#endif
16072-
16073-
"
16074-
if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
16075-
ac_have_decl=1
16076-
else
16077-
ac_have_decl=0
16078-
fi
16079-
16080-
cat >>confdefs.h <<_ACEOF
16081-
#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
16082-
_ACEOF
16083-
16084-
1608516067
ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
1608616068
if test "x$ac_cv_func_syslog" = xyes; then :
1608716069
ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"

‎configure.in

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,14 +1787,6 @@ if test "$PORTNAME" = "cygwin"; then
17871787
AC_LIBOBJ(dirmod)
17881788
fi
17891789

1790-
AC_CHECK_DECLS([sys_siglist], [], [],
1791-
[#include <signal.h>
1792-
/* NetBSD declares sys_siglist in unistd.h. */
1793-
#ifdef HAVE_UNISTD_H
1794-
# include <unistd.h>
1795-
#endif
1796-
])
1797-
17981790
AC_CHECK_FUNC(syslog,
17991791
[AC_CHECK_HEADER(syslog.h,
18001792
[AC_DEFINE(HAVE_SYSLOG, 1, [Define to 1 if you have the syslog interface.])])])

‎src/include/pg_config.h.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,6 @@
192192
don't. */
193193
#undef HAVE_DECL_STRTOULL
194194

195-
/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
196-
don't. */
197-
#undef HAVE_DECL_SYS_SIGLIST
198-
199195
/* Define to 1 if you have the `dlopen' function. */
200196
#undef HAVE_DLOPEN
201197

‎src/port/pgstrsignal.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* the string will remain valid across later calls to strsignal().
3232
*
3333
* This version guarantees to return a non-NULL pointer, although
34-
* some platforms' versions of strsignal() do not.
34+
* some platforms' versions of strsignal()reputedlydo not.
3535
*/
3636
constchar*
3737
pg_strsignal(intsignum)
@@ -40,21 +40,18 @@ pg_strsignal(int signum)
4040

4141
/*
4242
* If we have strsignal(3), use that --- but check its result for NULL.
43-
* Otherwise, if we have sys_siglist[], use that; just out of paranoia,
44-
* check for NULL there too. (We assume there is no point in trying both
45-
* APIs.)
4643
*/
47-
#if defined(HAVE_STRSIGNAL)
44+
#ifdefHAVE_STRSIGNAL
4845
result=strsignal(signum);
4946
if (result)
5047
returnresult;
51-
#elif defined(HAVE_DECL_SYS_SIGLIST)&&HAVE_DECL_SYS_SIGLIST
52-
if (signum>0&&signum<NSIG)
53-
{
54-
result=sys_siglist[signum];
55-
if (result)
56-
returnresult;
57-
}
48+
#else
49+
50+
/*
51+
* We used to have code here to try to usesys_siglist[] if available.
52+
* However, it seems that all platforms with sys_siglist[] have also had
53+
* strsignal() for many years now, so that was just a waste of code.
54+
*/
5855
#endif
5956

6057
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp