]> The Tcpdump Group git mirrors - tcpdump/blobdiff - instrument-functions.c
Cirrus CI: Configure with --enable-smb in the Coverity task
[tcpdump] / instrument-functions.c
index 5c546125b0a28f6f65a0711ef690b9848ac7fefa..fb2314dd3f02c25561e9bca7b342b76192d10f37 100644 (file)
@@ -86,12 +86,19 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
        static long symcount;
        static asection *text;
        static bfd_vma vma;
+       static int instrument_off;
        static int print_only_global;
        symbol_info syminfo;
        struct stat statbuf;
-       int i, found;
+       int i;
 
-       if (!stat(ND_FILE_FLAG_OFF, &statbuf))
+       if (!instrument_off) {
+               /* one-time test */
+               if (!stat(ND_FILE_FLAG_OFF, &statbuf)) {
+                       instrument_off = 1;
+                       return;
+               }
+       } else
                return;
 
        /* If no errors, this block should be executed one time */
@@ -143,6 +150,8 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
        }
 
        if (print_only_global) {
+               int found;
+
                i = 0;
                found = 0;
                while (i < symcount && !found) {