summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-11-22 11:26:51 +0100
committerThomas Haller <thaller@redhat.com>2019-11-22 11:39:47 +0100
commit87af96a9d665354c59a87e5561ae993b9a79a6db (patch)
treeba37e7f78bc4b9b2a8f2fe1314cc4524337d19ba
parent234cb5a92332fdc91837d23934b960342b500072 (diff)
downloadNetworkManager-87af96a9d665354c59a87e5561ae993b9a79a6db.tar.gz
ifcfg: add svSetValueBoolean_cond_true() helper
-rw-r--r--src/settings/plugins/ifcfg-rh/shvar.c6
-rw-r--r--src/settings/plugins/ifcfg-rh/shvar.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c
index 5fce7525c1..16b2dd3762 100644
--- a/src/settings/plugins/ifcfg-rh/shvar.c
+++ b/src/settings/plugins/ifcfg-rh/shvar.c
@@ -1338,6 +1338,12 @@ svSetValueBoolean (shvarFile *s, const char *key, gboolean value)
}
gboolean
+svSetValueBoolean_cond_true (shvarFile *s, const char *key, gboolean value)
+{
+ return svSetValue (s, key, value ? "yes" : NULL);
+}
+
+gboolean
svSetValueEnum (shvarFile *s, const char *key, GType gtype, int value)
{
gs_free char *v = NULL;
diff --git a/src/settings/plugins/ifcfg-rh/shvar.h b/src/settings/plugins/ifcfg-rh/shvar.h
index 802eb7df8a..c3bbababa8 100644
--- a/src/settings/plugins/ifcfg-rh/shvar.h
+++ b/src/settings/plugins/ifcfg-rh/shvar.h
@@ -72,6 +72,7 @@ gboolean svGetValueEnum (shvarFile *s, const char *key,
gboolean svSetValue (shvarFile *s, const char *key, const char *value);
gboolean svSetValueStr (shvarFile *s, const char *key, const char *value);
gboolean svSetValueBoolean (shvarFile *s, const char *key, gboolean value);
+gboolean svSetValueBoolean_cond_true (shvarFile *s, const char *key, gboolean value);
gboolean svSetValueInt64 (shvarFile *s, const char *key, gint64 value);
gboolean svSetValueInt64_cond (shvarFile *s, const char *key, gboolean do_set, gint64 value);
gboolean svSetValueEnum (shvarFile *s, const char *key, GType gtype, int value);