Skip to content

Commit 06aac75

Browse files
committed
Fix: cib: properly mark variable as volatile
1 parent 3738ed4 commit 06aac75

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cib/cibio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ extern xmlNode *readCibXmlFile(const char *dir, const char *file, gboolean disca
4343
extern int activateCibBuffer(char *buffer, const char *filename);
4444
extern int activateCibXml(xmlNode * doc, gboolean to_disk, const char *op);
4545
extern crm_trigger_t *cib_writer;
46-
extern gboolean cib_writes_enabled;
46+
extern volatile gboolean cib_writes_enabled;
4747

4848
#endif

cib/main.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ GMainLoop *mainloop = NULL;
7575
const char *cib_root = NULL;
7676
char *cib_our_uname = NULL;
7777
gboolean preserve_status = FALSE;
78-
gboolean cib_writes_enabled = TRUE;
78+
79+
/* volatile because it may be changed in a signal handler */
80+
volatile gboolean cib_writes_enabled = TRUE;
81+
7982
int remote_fd = 0;
8083
int remote_tls_fd = 0;
8184

0 commit comments

Comments
 (0)