Print this page
11506 smatch resync

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/smatch_data/db/init_constraints_required.pl
          +++ new/usr/src/tools/smatch/src/smatch_data/db/init_constraints_required.pl
↓ open down ↓ 26 lines elided ↑ open up ↑
  27   27      $db->do("PRAGMA locking = EXCLUSIVE");
  28   28  }
  29   29  
  30   30  sub load_manual_constraints($$)
  31   31  {
  32   32      my $full_path = shift;
  33   33      my $project = shift;
  34   34      my $dir = dirname($full_path);
  35   35      my ($data, $op, $limit);
  36   36  
       37 +    if ($project =~ /^$/) {
       38 +        return;
       39 +    }
       40 +
  37   41      open(FILE, "$dir/$project.constraints_required");
  38   42      while (<FILE>) {
  39   43          ($data, $op, $limit) = split(/,/);
  40   44          $op =~ s/ //g;
  41   45          $limit =~ s/^ +//;
  42   46          $limit =~ s/\n//;
  43   47          $db->do("insert into constraints_required values (?, ?, ?);", undef, $data, $op, $limit);
  44   48      }
  45   49      close(FILE);
  46   50  
  47   51      $db->commit();
  48   52  }
  49   53  
  50   54  connect_to_db($db_file);
  51   55  load_manual_constraints($0, $project);
  52   56  
  53   57  $db->commit();
  54   58  $db->disconnect();
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX