From f792f1d8650e4925fe84d0f96f6df90d7ea89abc Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sat, 28 Aug 2004 02:29:40 +0000 Subject: [PATCH] - If error string begins with "warning: ", don't exit, treat it as a warning only. - Use getprogname() function when informing about versions problem. --- sbin/geom/core/geom.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index c32717966d32..a77af7e94cca 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -420,8 +420,10 @@ run_command(int argc, char *argv[]) } if (errstr != NULL) { fprintf(stderr, "%s\n", errstr); - gctl_free(req); - exit(EXIT_FAILURE); + if (strncmp(errstr, "warning: ", strlen("warning: ")) != 0) { + gctl_free(req); + exit(EXIT_FAILURE); + } } if (*buf != '\0') printf("%s", buf); @@ -460,8 +462,8 @@ load_library(void) } if (*lib_version != G_LIB_VERSION) { dlclose(dlh); - errx(EXIT_FAILURE, "%s and %s are not synchronized.", comm, - path); + errx(EXIT_FAILURE, "%s and %s are not synchronized.", + getprogname(), path); } version = dlsym(dlh, "version"); if (version == NULL) {