Skip to content

Commit 4677818

Browse files
committed
Fix s_lock_test compile
This is a mostly unused tool, but I discovered while nosing around the Makefile that it hasn't been kept in line with other changes. Fix it. Backpatching doesn't appear to be necessary. Discussion: https://postgr.es/m/202401241114.ied53jcich72@alvherre.pgsql
1 parent fba2112 commit 4677818

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/backend/storage/lmgr/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif
3333
s_lock_test: s_lock.c $(top_builddir)/src/common/libpgcommon.a $(top_builddir)/src/port/libpgport.a
3434
$(CC) $(CPPFLAGS) $(CFLAGS) -DS_LOCK_TEST=1 $(srcdir)/s_lock.c \
3535
$(TASPATH) -L $(top_builddir)/src/common -lpgcommon \
36-
-L $(top_builddir)/src/port -lpgport -o s_lock_test
36+
-L $(top_builddir)/src/port -lpgport -lm -o s_lock_test
3737

3838
# see notes in src/backend/parser/Makefile
3939
lwlocknames.c: lwlocknames.h

src/backend/storage/lmgr/s_lock.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161
#define MIN_DELAY_USEC 1000L
6262
#define MAX_DELAY_USEC 1000000L
6363

64+
#ifdef S_LOCK_TEST
65+
/*
66+
* These are needed by pgstat_report_wait_start in the standalone compile of
67+
* s_lock_test.
68+
*/
69+
static uint32 local_my_wait_event_info;
70+
uint32 *my_wait_event_info = &local_my_wait_event_info;
71+
#endif
6472

6573
slock_t dummy_spinlock;
6674

0 commit comments

Comments
 (0)