From a0ca6f506f6a2ecfde9e49e7d9239b26327b5d8a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 26 Jun 2018 11:14:08 +0200 Subject: c-e: change static string array "certcon" to #define of string literal We usually don't use static string arrays to represent (what essentially are) string literals. Also, it's constant and thus should be upper-case. --- src/connection-editor/nm-connection-editor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c index b40a45c7..60472e7a 100644 --- a/src/connection-editor/nm-connection-editor.c +++ b/src/connection-editor/nm-connection-editor.c @@ -183,7 +183,7 @@ update_sensitivity (NMConnectionEditor *editor) #if WITH_SELINUX /* This is what the files in ~/.cert would get. */ -static const char certcon[] = "unconfined_u:object_r:home_cert_t:s0"; +#define CERTCON "unconfined_u:object_r:home_cert_t:s0" static void update_relabel_list_filename (GtkListStore *relabel_list, char *filename) @@ -213,7 +213,7 @@ update_relabel_list_filename (GtkListStore *relabel_list, char *filename) return; } - if (g_strcmp0 (certcon, tcon) == 0) + if (g_strcmp0 (CERTCON, tcon) == 0) return; writable = (access (filename, W_OK) == 0); @@ -304,7 +304,7 @@ relabel_button_clicked_cb (GtkWidget *widget, gpointer user_data) 2, &filename, -1); if (relabel) { - if (setfilecon (filename, certcon) == -1) { + if (setfilecon (filename, CERTCON) == -1) { int errsv = errno; g_warning ("setfilecon: failed for \"%s\" with %s\n", filename, g_strerror (errsv)); -- cgit v1.2.1