[SSSD] [PATCH] tools: Don't shadow 'exit'

Jakub Hrozek jhrozek at redhat.com
Mon Nov 9 14:33:33 UTC 2015


On Mon, Nov 09, 2015 at 10:44:49AM +0100, Lukas Slebodnik wrote:
> Obvious ACK

While reviewing your patches, I found one more place I forgot to fix,
see the attached patch.
-------------- next part --------------
>From b275e167c4c802c838d8b3d4d2d419e8af6fa99b Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Mon, 9 Nov 2015 10:27:41 +0100
Subject: [PATCH] tools: Don't shadow 'exit'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes:
    /sssd/src/tools/sss_override.c: In function ‘override_user_import’:
    /sssd/src/tools/sss_override.c:1471: warning: declaration of ‘exit’ shadows a global declaration
    /usr/include/stdlib.h:544: warning: shadowed declaration is here
    /sssd/src/tools/sss_override.c: In function ‘override_group_import’:
    /sssd/src/tools/sss_override.c:1737: warning: declaration of ‘exit’ shadows a global declaration
    /usr/include/stdlib.h:544: warning: shadowed declaration is here
---
 src/tools/sss_override.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/tools/sss_override.c b/src/tools/sss_override.c
index 7059809fe8dfeb367bf77e84f308e0d810a61145..3eb1191959653c6e4ad9b981c045956572fdc556 100644
--- a/src/tools/sss_override.c
+++ b/src/tools/sss_override.c
@@ -1468,7 +1468,7 @@ static int override_user_import(struct sss_cmdline *cmdline,
     struct override_user obj;
     int linenum = 1;
     errno_t ret;
-    int exit;
+    int rc;
 
     tmp_ctx = talloc_new(NULL);
     if (tmp_ctx == NULL) {
@@ -1493,14 +1493,14 @@ static int override_user_import(struct sss_cmdline *cmdline,
     ret = parse_cmdline_import(cmdline, &filename);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse command line.\n");
-        exit = EXIT_FAILURE;
+        rc = EXIT_FAILURE;
         goto done;
     }
 
     db = sss_colondb_open(tool_ctx, SSS_COLONDB_READ, filename);
     if (db == NULL) {
         fprintf(stderr, _("Unable to open %s.\n"), filename);
-        exit = EXIT_FAILURE;
+        rc = EXIT_FAILURE;
         goto done;
     }
 
@@ -1511,19 +1511,19 @@ static int override_user_import(struct sss_cmdline *cmdline,
                                   &obj.orig_name, &obj.domain);
         if (ret != EOK) {
             fprintf(stderr, _("Unable to parse name %s.\n"), obj.input_name);
-            exit = EXIT_FAILURE;
+            rc = EXIT_FAILURE;
             goto done;
         }
 
         ret = get_user_domain_msg(tool_ctx, &obj);
         if (ret != EOK) {
-            exit = EXIT_FAILURE;
+            rc = EXIT_FAILURE;
             goto done;
         }
 
         ret = override_user(tool_ctx, &obj);
         if (ret != EOK) {
-            exit = EXIT_FAILURE;
+            rc = EXIT_FAILURE;
             goto done;
         }
 
@@ -1533,15 +1533,15 @@ static int override_user_import(struct sss_cmdline *cmdline,
     if (ret != EOF) {
         fprintf(stderr, _("Invalid format on line %d. "
                 "Use --debug option for more information.\n"), linenum);
-        exit = EXIT_FAILURE;
+        rc = EXIT_FAILURE;
         goto done;
     }
 
-    exit = EXIT_SUCCESS;
+    rc = EXIT_SUCCESS;
 
 done:
     talloc_free(tmp_ctx);
-    return exit;
+    return rc;
 }
 
 static int override_user_export(struct sss_cmdline *cmdline,
@@ -1734,7 +1734,7 @@ static int override_group_import(struct sss_cmdline *cmdline,
     struct override_group obj;
     int linenum = 1;
     errno_t ret;
-    int exit;
+    int rc;
 
     tmp_ctx = talloc_new(NULL);
     if (tmp_ctx == NULL) {
@@ -1755,14 +1755,14 @@ static int override_group_import(struct sss_cmdline *cmdline,
     ret = parse_cmdline_import(cmdline, &filename);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse command line.\n");
-        exit = EXIT_FAILURE;
+        rc = EXIT_FAILURE;
         goto done;
     }
 
     db = sss_colondb_open(tool_ctx, SSS_COLONDB_READ, filename);
     if (db == NULL) {
         fprintf(stderr, _("Unable to open %s.\n"), filename);
-        exit = EXIT_FAILURE;
+        rc = EXIT_FAILURE;
         goto done;
     }
 
@@ -1773,19 +1773,19 @@ static int override_group_import(struct sss_cmdline *cmdline,
                                   &obj.orig_name, &obj.domain);
         if (ret != EOK) {
             fprintf(stderr, _("Unable to parse name %s.\n"), obj.input_name);
-            exit = EXIT_FAILURE;
+            rc = EXIT_FAILURE;
             goto done;
         }
 
         ret = get_group_domain_msg(tool_ctx, &obj);
         if (ret != EOK) {
-            exit = EXIT_FAILURE;
+            rc = EXIT_FAILURE;
             goto done;
         }
 
         ret = override_group(tool_ctx, &obj);
         if (ret != EOK) {
-            exit = EXIT_FAILURE;
+            rc = EXIT_FAILURE;
             goto done;
         }
 
@@ -1795,15 +1795,15 @@ static int override_group_import(struct sss_cmdline *cmdline,
     if (ret != EOF) {
         fprintf(stderr, _("Invalid format on line %d. "
                 "Use --debug option for more information.\n"), linenum);
-        exit = EXIT_FAILURE;
+        rc = EXIT_FAILURE;
         goto done;
     }
 
-    exit = EXIT_SUCCESS;
+    rc = EXIT_SUCCESS;
 
 done:
     talloc_free(tmp_ctx);
-    return exit;
+    return rc;
 }
 
 static int override_group_export(struct sss_cmdline *cmdline,
-- 
2.4.3



More information about the sssd-devel mailing list