1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

r363: nicer error handling in pidl

This commit is contained in:
Andrew Tridgell 2004-04-26 02:05:48 +00:00 committed by Gerald (Jerry) Carter
parent b2ebaf95b7
commit cafc8a5e76
2 changed files with 3 additions and 1 deletions

View File

@ -124,8 +124,9 @@ sub process_file($)
} }
} else { } else {
$pidl = util::LoadStructure($pidl_file); $pidl = util::LoadStructure($pidl_file);
defined $pidl || die "Failed to load $pidl_file - maybe you need --parse\n";
} }
if ($opt_dump) { if ($opt_dump) {
print IdlDump::Dump($pidl); print IdlDump::Dump($pidl);
} }

View File

@ -10,6 +10,7 @@ sub LoadStructure($)
{ {
my $f = shift; my $f = shift;
my $contents = FileLoad($f); my $contents = FileLoad($f);
defined $contents || return undef;
return eval "$contents"; return eval "$contents";
} }