Fix exit code for non-existent file.
authorDario Lombardo <lomato@gmail.com>
Sat, 7 Jan 2017 20:57:57 +0000 (21:57 +0100)
committerAnders Broman <a.broman58@gmail.com>
Sun, 8 Jan 2017 08:10:59 +0000 (08:10 +0000)
The patched command line utilities have been aligned to tshark
behavior.

Change-Id: I0cb764b37792e882e182681124341893b3958c59
Reviewed-on: https://code.wireshark.org/review/19580
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
capinfos.c
captype.c
reordercap.c

index a6539cc672d56a2c169b1bfd5c04a4bf81059161..572f8afb362bd139cb7ee39ebec5cf852ae46c13 100644 (file)
@@ -1720,7 +1720,7 @@ main(int argc, char *argv[])
         fprintf(stderr, "(%s)\n", err_info);
         g_free(err_info);
       }
-      overall_error_status = 1; /* remember that an error has occurred */
+      overall_error_status = 2; /* remember that an error has occurred */
       if (!continue_after_wtap_open_offline_failure)
         goto exit;
     }
index 133a8bf37ed1469a3ee418f8beca90dd3ac4b8bd..1d83f573ef882c34d031ff7379f855c82cdcaa1e 100644 (file)
--- a/captype.c
+++ b/captype.c
@@ -210,7 +210,7 @@ main(int argc, char *argv[])
           fprintf(stderr, "(%s)\n", err_info);
           g_free(err_info);
         }
-        overall_error_status = 1; /* remember that an error has occurred */
+        overall_error_status = 2; /* remember that an error has occurred */
       }
     }
 
index 4f453dc464d9533b816486631ae29d354e2e349f..b56fcfdeed834f0f313bd42762b8eda1598a5ac5 100644 (file)
@@ -295,7 +295,7 @@ main(int argc, char *argv[])
             fprintf(stderr, "(%s)\n", err_info);
             g_free(err_info);
         }
-        exit(1);
+        exit(2);
     }
     DEBUG_PRINT("file_type_subtype is %d\n", wtap_file_type_subtype(wth));