]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ufsdump.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / ufsdump.cc
index 9bbb9d72e622485e8802aa5d898c71218f06b1b8..bbacc9f25dcdfd91cf213cce25b5843049c84e47 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -52,14 +52,14 @@ void
 death(int sig)
 {
     std::cout << "Fatal: Signal " <<  sig;
-    exit(1);
+    exit(EXIT_FAILURE);
 }
 
 void
 fatal(const char *message)
 {
     fprintf(stderr, "FATAL: %s\n", message);
-    exit(1);
+    exit(EXIT_FAILURE);
 }
 
 /* end stub functions */
@@ -161,9 +161,8 @@ main(int argc, char *argv[])
 
         for_each(*metadata, dumper);
 
-        return 0;
-    } catch (std::runtime_error error) {
-        std::cout << "Failed : " << error.what() << std::endl;
+    } catch (const std::exception &e) {
+        std::cout << "Failed : " << e.what() << std::endl;
 
         if (fd >= 0)
             close(fd);
@@ -171,7 +170,9 @@ main(int argc, char *argv[])
         if (metadata)
             StoreMeta::FreeList(&metadata);
 
-        return 1;
+        return EXIT_FAILURE;
     }
+
+    return EXIT_SUCCESS;
 }