Skip to content

Commit

Permalink
Low: Build: Fix compile error without upstart and systemd on RHEL6
Browse files Browse the repository at this point in the history
- add g_list_free_full function for old glib
- fix redefinition of lrmd_key_value_t
  • Loading branch information
t-matsuo committed Jul 5, 2012
1 parent 60a19ed commit a92958f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions configure.ac
Expand Up @@ -631,6 +631,11 @@ if test "x$ac_cv_lib_glib_2_0_g_hash_table_get_values" != x""yes; then
AC_MSG_WARN(Your version of Glib is too old, you should have at least 2.14)
fi

AC_CHECK_LIB(glib-2.0, g_list_free_full)
if test "x$ac_cv_lib_glib_2_0_g_list_free_full" != x""yes; then
AC_DEFINE_UNQUOTED(NEED_G_LIST_FREE_FULL, 1, glib-2.0 has no g_list_free_full)
fi

if
$PKGCONFIG --exists systemd
then
Expand Down
8 changes: 8 additions & 0 deletions include/crm/common/util.h
Expand Up @@ -160,4 +160,12 @@ char *crm_md5sum(const char *buffer);
char *crm_generate_uuid(void);
int crm_user_lookup(const char *name, uid_t * uid, gid_t * gid);

#ifdef NEED_G_LIST_FREE_FULL
static inline void g_list_free_full(GList *list, GDestroyNotify free_func)
{
g_list_foreach(list, (GFunc) free_func, NULL);
g_list_free(list);
}
#endif

#endif
8 changes: 6 additions & 2 deletions include/crm/lrmd.h
Expand Up @@ -21,8 +21,12 @@
#define LRMD__H

typedef struct lrmd_s lrmd_t;
typedef struct lrmd_key_value_s lrmd_key_value_t;
struct lrmd_key_value_t;
typedef struct lrmd_key_value_s {
char *key;
char *value;
struct lrmd_key_value_s *next;
} lrmd_key_value_t;


/* *INDENT-OFF* */
#define F_LRMD_OPERATION "lrmd_op"
Expand Down
5 changes: 0 additions & 5 deletions lib/lrmd/lrmd_client.c
Expand Up @@ -43,11 +43,6 @@
CRM_TRACE_INIT_DATA(lrmd);

static stonith_t *stonith_api = NULL;
typedef struct lrmd_key_value_s {
char *key;
char *value;
struct lrmd_key_value_s *next;
} lrmd_key_value_t;

typedef struct lrmd_private_s {
int call_id;
Expand Down

0 comments on commit a92958f

Please sign in to comment.