File pacemaker-libcrmcommon-message-cannot-open-dump-file.patch of Package pacemaker.8397
commit b30af11ddd465a299cf1bd66cc3c42a1ce741368
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Tue Apr 4 16:22:03 2017 -0500
Log: libcrmcommon: more useful message if can't open dump file
also avoids a static analysis false positive
Index: pacemaker/lib/common/xml.c
===================================================================
--- pacemaker.orig/lib/common/xml.c
+++ pacemaker/lib/common/xml.c
@@ -5540,7 +5540,10 @@ dump_file(const char *filename)
CRM_CHECK(filename != NULL, return);
fp = fopen(filename, "r");
- CRM_CHECK(fp != NULL, return);
+ if (fp == NULL) {
+ crm_perror(LOG_ERR, "Could not open %s for reading", filename);
+ return;
+ }
fprintf(stderr, "%4d ", ++line);
do {