From: Jim Meyering <[email protected]>

* exec/coroparse.c: Add const.  Tweak s/fp==0/fp==NULL/
---
 exec/coroparse.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/exec/coroparse.c b/exec/coroparse.c
index 02c6e97..19c79f0 100644
--- a/exec/coroparse.c
+++ b/exec/coroparse.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 Red Hat, Inc.
+ * Copyright (c) 2006, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -57,11 +57,12 @@

 static int read_config_file_into_objdb(
        struct objdb_iface_ver0 *objdb,
-       char **error_string);
+       const char **error_string);
 static char error_string_response[512];


-static int aisparser_readconfig (struct objdb_iface_ver0 *objdb, char 
**error_string)
+static int aisparser_readconfig (struct objdb_iface_ver0 *objdb,
+                                const char **error_string)
 {
        if (read_config_file_into_objdb(objdb, error_string)) {
                return -1;
@@ -87,7 +88,7 @@ static char *remove_whitespace(char *string)
 static int parse_section(FILE *fp,
                         struct objdb_iface_ver0 *objdb,
                         hdb_handle_t parent_handle,
-                        char **error_string)
+                        const char **error_string)
 {
        char line[512];
        int i;
@@ -157,10 +158,10 @@ static int parse_section(FILE *fp,
 /* Read config file and load into objdb */
 static int read_config_file_into_objdb(
        struct objdb_iface_ver0 *objdb,
-       char **error_string)
+       const char **error_string)
 {
        FILE *fp;
-       char *filename;
+       const char *filename;
        char *error_reason = error_string_response;
        int res;

@@ -169,7 +170,7 @@ static int read_config_file_into_objdb(
                filename = SYSCONFDIR "/corosync.conf";

        fp = fopen (filename, "r");
-       if (fp == 0) {
+       if (fp == NULL) {
                sprintf (error_reason, "Can't read file %s reason = (%s)\n",
                         filename, strerror (errno));
                *error_string = error_reason;
@@ -220,5 +221,3 @@ __attribute__ ((constructor)) static void 
aisparser_comp_register (void) {
         lcr_interfaces_set (&corosync_aisparser_ver0[0], 
&aisparser_iface_ver0);
        lcr_component_register (&aisparser_comp_ver0);
 }
-
-
-- 
1.6.2.rc1.285.gc5f54

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to