going_down can return; so return early if it does.
authorChristos Zoulas <christos@zoulas.com>
Thu, 6 Oct 2011 14:23:31 +0000 (10:23 -0400)
committerChristos Zoulas <christos@zoulas.com>
Thu, 6 Oct 2011 14:23:31 +0000 (10:23 -0400)
amd/amd.c

index fd5b7927b114d54cc3621836b35528087e74bcea..cd630e6480fb277786138a7bc35c0bb7b351f4d8 100644 (file)
--- a/amd/amd.c
+++ b/amd/amd.c
@@ -427,6 +427,7 @@ main(int argc, char *argv[])
   if (gethostname(hostname, sizeof(hostname)) < 0) {
     plog(XLOG_FATAL, "gethostname: %m");
     going_down(1);
+    return;
   }
   hostname[sizeof(hostname) - 1] = '\0';
 
@@ -436,6 +437,7 @@ main(int argc, char *argv[])
   if (!*hostname) {
     plog(XLOG_FATAL, "host name is not set");
     going_down(1);
+    return;
   }
 
   /*
@@ -529,6 +531,7 @@ main(int argc, char *argv[])
   if (geteuid() != 0) {
     plog(XLOG_FATAL, "Must be root to mount filesystems (euid = %ld)", (long) geteuid());
     going_down(1);
+    return;
   }
 
 #ifdef HAVE_MAP_NIS
@@ -540,6 +543,7 @@ main(int argc, char *argv[])
   if (gopt.nis_domain && yp_bind(gopt.nis_domain)) {
     plog(XLOG_FATAL, "Can't bind to NIS domain \"%s\"", gopt.nis_domain);
     going_down(1);
+    return;
   }
 #endif /* HAVE_MAP_NIS */