chain.c32: error out on missing boot sector signature
[syslinux.git] / mbr / checksize.pl
blob68a035b7277819c72f47752f2df324d8234c53a9
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
4 ##
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ## Boston MA 02111-1307, USA; either version 2 of the License, or
9 ## (at your option) any later version; incorporated herein by reference.
11 ## -----------------------------------------------------------------------
14 ## checksize.pl
16 ## Check the size of a binary file
19 ($file, $maxsize) = @ARGV;
21 @st = stat($file);
22 if (!defined($size = $st[7])) {
23 die "$0: $file: $!\n";
25 if ($size > $maxsize) {
26 print STDERR "$file: too big ($size > $maxsize)\n";
27 exit 1;
28 } else {
29 exit 0;