summaryrefslogtreecommitdiffstats
path: root/src/signframework/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/signframework/utils.c')
-rw-r--r--src/signframework/utils.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/signframework/utils.c b/src/signframework/utils.c
index 6edd0cc..f90f631 100644
--- a/src/signframework/utils.c
+++ b/src/signframework/utils.c
@@ -99,8 +99,16 @@ int File_Open(FILE **file,
if (rc == 0) {
*file = fopen(filename, mode);
if (*file == NULL) {
- if (verbose) fprintf(messageFile, "File_Open: Error opening %s for %s, %s\n",
+ if (verbose) {
+ // Check to make sure we aren't attempting to reroute the message file
+ if (file != &messageFile) {
+ fprintf(messageFile, "File_Open: Error opening %s for %s, %s\n",
filename, mode, strerror(errno));
+ } else {
+ fprintf(stderr, "File_Open: Error opening %s for %s, %s\n",
+ filename, mode, strerror(errno));
+ }
+ }
rc = ERROR_CODE;
}
}
@@ -135,12 +143,12 @@ int File_OpenMessageFile(const char *outputBodyFilename,
}
/* if the open failed */
else {
+ messageFile = stdout;
fprintf(messageFile,
"File_OpenMessageFile: Error cannot open %s\n", outputBodyFilename);
/* Since the configuration is validated at startup, this should never fail. The only
possibilty is that something happened to the platform while the framework was
running. No email can be returned and messages go to stdout. */
- messageFile= stdout;
rc = RESPONSE_NO_EMAIL;
}
return rc;
@@ -817,7 +825,7 @@ int File_GetValueArray(char ***values, /* freed by caller */
if (rc == 0) {
if (*values != NULL) {
if (verbose) fprintf(messageFile,
- "File_GetNameValueArray: values %p not NULL\n",
+ "File_GetValueArray: values %p not NULL\n",
*values);
}
}
OpenPOWER on IntegriCloud