changeset 5190:12b6ba947111 draft

Do not report an error if control_group is already set
author Quentin Carbonneaux <quentin@c9x.me>
date Tue, 05 May 2020 17:43:04 +0200
parents d8a7afd72391
children dfbd1f961093
files src/if-options.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/if-options.c	Mon May 04 16:32:37 2020 +0100
+++ b/src/if-options.c	Tue May 05 17:43:04 2020 +0200
@@ -2120,7 +2120,8 @@
 			return -1;
 		}
 		if (grp == NULL) {
-			logerrx("controlgroup: %s: not found", arg);
+			if (!ctx->control_group)
+				logerrx("controlgroup: %s: not found", arg);
 			free(p);
 			return -1;
 		}
@@ -2129,7 +2130,8 @@
 #else
 		grp = getgrnam(arg);
 		if (grp == NULL) {
-			logerrx("controlgroup: %s: not found", arg);
+			if (!ctx->control_group)
+				logerrx("controlgroup: %s: not found", arg);
 			return -1;
 		}
 		ctx->control_group = grp->gr_gid;