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

Commitd3cc5ff

Browse files
committed
Move extern declarations for EXEC_BACKEND to header files
This fixes warnings from -Wmissing-variable-declarations (not yet partof the standard warning options) under EXEC_BACKEND. TheNON_EXEC_STATIC variables need a suitable declaration in a header fileunder EXEC_BACKEND.Also fix the inconsistent application of the volatile qualifier forPMSignalState, which was revealed by this change.Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
1 parent840b3b5 commitd3cc5ff

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

‎src/backend/postmaster/launch_backend.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ typedef struct
114114
PROC_HDR*ProcGlobal;
115115
PGPROC*AuxiliaryProcs;
116116
PGPROC*PreparedXactProcs;
117-
PMSignalData*PMSignalState;
117+
volatilePMSignalData*PMSignalState;
118118
pid_tPostmasterPid;
119119
TimestampTzPgStartTime;
120120
TimestampTzPgReloadTime;
@@ -668,16 +668,6 @@ SubPostmasterMain(int argc, char *argv[])
668668
pg_unreachable();/* main_fn never returns */
669669
}
670670

671-
/*
672-
* The following need to be available to the save/restore_backend_variables
673-
* functions. They are marked NON_EXEC_STATIC in their home modules.
674-
*/
675-
externslock_t*ProcStructLock;
676-
externPGPROC*AuxiliaryProcs;
677-
externPMSignalData*PMSignalState;
678-
externpg_time_tfirst_syslogger_file_time;
679-
externstructbkend*ShmemBackendArray;
680-
681671
#ifndefWIN32
682672
#definewrite_inheritable_socket(dest,src,childpid) ((*(dest) = (src)), true)
683673
#defineread_inheritable_socket(dest,src) (*(dest) = *(src))

‎src/include/postmaster/postmaster.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ extern PGDLLIMPORT bool remove_temp_files_after_crash;
3636
externPGDLLIMPORTboolsend_abort_for_crash;
3737
externPGDLLIMPORTboolsend_abort_for_kill;
3838

39+
#ifdefEXEC_BACKEND
40+
externstructbkend*ShmemBackendArray;
41+
#endif
42+
3943
#ifdefWIN32
4044
externPGDLLIMPORTHANDLEPostmasterHandle;
4145
#else

‎src/include/postmaster/syslogger.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ extern PGDLLIMPORT char *Log_filename;
7575
externPGDLLIMPORTboolLog_truncate_on_rotation;
7676
externPGDLLIMPORTintLog_file_mode;
7777

78+
#ifdefEXEC_BACKEND
79+
externpg_time_tfirst_syslogger_file_time;
80+
#endif
81+
7882
#ifndefWIN32
7983
externPGDLLIMPORTintsyslogPipe[2];
8084
#else

‎src/include/storage/pmsignal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ typedef enum
5757
/* PMSignalData is an opaque struct, details known only within pmsignal.c */
5858
typedefstructPMSignalDataPMSignalData;
5959

60+
#ifdefEXEC_BACKEND
61+
externvolatilePMSignalData*PMSignalState;
62+
#endif
63+
6064
/*
6165
* prototypes for functions in pmsignal.c
6266
*/

‎src/include/storage/proc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,11 @@ extern PGDLLIMPORT int TransactionTimeout;
453453
externPGDLLIMPORTintIdleSessionTimeout;
454454
externPGDLLIMPORTboollog_lock_waits;
455455

456+
#ifdefEXEC_BACKEND
457+
externslock_t*ProcStructLock;
458+
externPGPROC*AuxiliaryProcs;
459+
#endif
460+
456461

457462
/*
458463
* Function Prototypes

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp