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

Commit91ed399

Browse files
committed
Use autoconf build-in sys_siglist macro AC_DECL_SYS_SIGLIST, rather than
create our own.
1 parent9bf559d commit91ed399

File tree

5 files changed

+45
-33
lines changed

5 files changed

+45
-33
lines changed

‎configure

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15600,9 +15600,9 @@ fi
1560015600
rm -f conftest.err conftest.$ac_objext \
1560115601
conftest$ac_exeext conftest.$ac_ext
1560215602

15603-
echo "$as_me:$LINENO: checkingfor sys_siglist" >&5
15604-
echo $ECHO_N "checkingfor sys_siglist... $ECHO_C" >&6
15605-
if test "${pgac_cv_var_sys_siglist+set}" = set; then
15603+
echo "$as_me:$LINENO: checkingwhether sys_siglist is declared" >&5
15604+
echo $ECHO_N "checkingwhether sys_siglist is declared... $ECHO_C" >&6
15605+
if test "${ac_cv_have_decl_sys_siglist+set}" = set; then
1560615606
echo $ECHO_N "(cached) $ECHO_C" >&6
1560715607
else
1560815608
cat >conftest.$ac_ext <<_ACEOF
@@ -15612,17 +15612,26 @@ cat confdefs.h >>conftest.$ac_ext
1561215612
cat >>conftest.$ac_ext <<_ACEOF
1561315613
/* end confdefs.h. */
1561415614
#include <signal.h>
15615+
/* NetBSD declares sys_siglist in unistd.h. */
15616+
#if HAVE_UNISTD_H
15617+
# include <unistd.h>
15618+
#endif
15619+
15620+
1561515621
int
1561615622
main ()
1561715623
{
15618-
extern char *sys_siglist[]; (void)sys_siglist[0];
15624+
#ifndef sys_siglist
15625+
char *p = (char *) sys_siglist;
15626+
#endif
15627+
1561915628
;
1562015629
return 0;
1562115630
}
1562215631
_ACEOF
15623-
rm -f conftest.$ac_objext conftest$ac_exeext
15624-
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
15625-
(eval $ac_link) 2>conftest.er1
15632+
rm -f conftest.$ac_objext
15633+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
15634+
(eval $ac_compile) 2>conftest.er1
1562615635
ac_status=$?
1562715636
grep -v '^ *+' conftest.er1 >conftest.err
1562815637
rm -f conftest.er1
@@ -15636,32 +15645,41 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
1563615645
ac_status=$?
1563715646
echo "$as_me:$LINENO: \$? = $ac_status" >&5
1563815647
(exit $ac_status); }; } &&
15639-
{ ac_try='test -s conftest$ac_exeext'
15648+
{ ac_try='test -s conftest.$ac_objext'
1564015649
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1564115650
(eval $ac_try) 2>&5
1564215651
ac_status=$?
1564315652
echo "$as_me:$LINENO: \$? = $ac_status" >&5
1564415653
(exit $ac_status); }; }; then
15645-
pgac_cv_var_sys_siglist=yes
15654+
ac_cv_have_decl_sys_siglist=yes
1564615655
else
1564715656
echo "$as_me: failed program was:" >&5
1564815657
sed 's/^/| /' conftest.$ac_ext >&5
1564915658

15650-
pgac_cv_var_sys_siglist=no
15659+
ac_cv_have_decl_sys_siglist=no
1565115660
fi
15652-
rm -f conftest.err conftest.$ac_objext \
15653-
conftest$ac_exeext conftest.$ac_ext
15661+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1565415662
fi
15655-
echo "$as_me:$LINENO: result: $pgac_cv_var_sys_siglist" >&5
15656-
echo "${ECHO_T}$pgac_cv_var_sys_siglist" >&6
15657-
if testx"$pgac_cv_var_sys_siglist" =x"yes"; then
15663+
echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
15664+
echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6
15665+
if test$ac_cv_have_decl_sys_siglist = yes; then
1565815666

15659-
cat >>confdefs.h <<\_ACEOF
15660-
#define HAVE_SYS_SIGLIST 1
15667+
cat >>confdefs.h <<_ACEOF
15668+
#define HAVE_DECL_SYS_SIGLIST 1
15669+
_ACEOF
15670+
15671+
15672+
else
15673+
cat >>confdefs.h <<_ACEOF
15674+
#define HAVE_DECL_SYS_SIGLIST 0
1566115675
_ACEOF
1566215676

15677+
1566315678
fi
1566415679

15680+
15681+
15682+
1566515683
echo "$as_me:$LINENO: checking for syslog" >&5
1566615684
echo $ECHO_N "checking for syslog... $ECHO_C" >&6
1566715685
if test "${ac_cv_func_syslog+set}" = set; then

‎configure.in

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.498 2007/01/2801:12:05 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.499 2007/01/2803:50:33 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1059,14 +1059,7 @@ AC_TRY_LINK([#include <setjmp.h>],
10591059
AC_MSG_RESULT(yes)],
10601060
[AC_MSG_RESULT(no)])
10611061

1062-
AC_CACHE_CHECK([for sys_siglist], pgac_cv_var_sys_siglist,
1063-
[AC_TRY_LINK([#include <signal.h>],
1064-
[extern char *sys_siglist[]; (void)sys_siglist[0];],
1065-
[pgac_cv_var_sys_siglist=yes],
1066-
[pgac_cv_var_sys_siglist=no])])
1067-
if test x"$pgac_cv_var_sys_siglist" = x"yes"; then
1068-
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define to 1 if you have the global variable 'char *sys_siglist[]'.])
1069-
fi
1062+
AC_DECL_SYS_SIGLIST
10701063

10711064
AC_CHECK_FUNC(syslog,
10721065
[AC_CHECK_HEADER(syslog.h,

‎src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.513 2007/01/2801:12:05 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.514 2007/01/2803:50:34 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -2430,7 +2430,7 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
24302430
(errmsg("%s (PID %d) was terminated by exception %X",
24312431
procname,pid,WTERMSIG(exitstatus)),
24322432
errhint("See C include file \"ntstatus.h\" for a description of the hex value.")));
2433-
#elif defined(HAVE_SYS_SIGLIST)
2433+
#elif defined(HAVE_DECL_SYS_SIGLIST)
24342434
ereport(lev,
24352435

24362436
/*------

‎src/include/pg_config.h.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
don't. */
9292
#undef HAVE_DECL_STRLCPY
9393

94+
/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
95+
don't. */
96+
#undef HAVE_DECL_SYS_SIGLIST
97+
9498
/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
9599
don't. */
96100
#undef HAVE_DECL_VSNPRINTF
@@ -478,9 +482,6 @@
478482
/* Define to 1 if you have the <sys/shm.h> header file. */
479483
#undef HAVE_SYS_SHM_H
480484

481-
/* Define to 1 if you have the global variable 'char *sys_siglist[]'. */
482-
#undef HAVE_SYS_SIGLIST
483-
484485
/* Define to 1 if you have the <sys/socket.h> header file. */
485486
#undef HAVE_SYS_SOCKET_H
486487

‎src/port/exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.50 2007/01/2802:33:09 momjian Exp $
12+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.51 2007/01/2803:50:34 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -586,7 +586,7 @@ pclose_check(FILE *stream)
586586
#if defined(WIN32)
587587
log_error(_("child process was terminated by exception %X\nSee C include file \"ntstatus.h\" for a description of the hex value."),
588588
WTERMSIG(exitstatus));
589-
#elif defined(HAVE_SYS_SIGLIST)
589+
#elif defined(HAVE_DECL_SYS_SIGLIST)
590590
log_error(_("child process was terminated by signal: %s"),
591591
WTERMSIG(exitstatus)<NSIG ?
592592
sys_siglist[WTERMSIG(exitstatus)] :"unknown signal");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp