Debian Codegraph @

dist/validate/s_chk_offt

raw
1 #!/bin/sh -
2 #
3 # $Id: s_chk_offt,v 0f73af5ae3da 2010/05/10 05:38:40 alexander $
4 #
5 # Make sure that no off_t's have snuck into the release.
6 # off_t check is done at runtime in env_sig.c We add a declaration for
7 # off_t to db.h, so it is always guaranteed to be available.
8 # MJC:We add a declaration for off_t to db.h, so it is always guaranteed to be
9 # available. There are already many many cases where data structures are
10 # different sizes on 64-bit systems than 32-bit systems (we have a runtime
11 # check for that in env_sig.c). Test is really obsolete.
12
13 d=../..
14 [ -f $d/LICENSE ] || {
15 echo 'FAIL: cannot find source distribution directory.'
16 exit 1
17 }
18
19 t=__1
20
21 egrep -w off_t $d/src/*/*.[ch] $d/util/*.[ch] $d/src/*/*.in |
22 sed -e "/#undef off_t/d" \
23 -e "/build_wince\//d" \
24 -e "/build_windows\//d" \
25 -e "/db_env_set_func_ftruncate/d" \
26 -e "/db_env_set_func_pread/d" \
27 -e "/db_env_set_func_pwrite/d" \
28 -e "/db_env_set_func_seek/d" \
29 -e "/env_register.c/d" \
30 -e "/j_ftruncate/d" \
31 -e "/j_pread/d" \
32 -e "/j_pwrite/d" \
33 -e "/j_seek/d" \
34 -e "/mp_fopen.c:.*can't use off_t's here/d" \
35 -e "/mp_fopen.c:.*size or type off_t's or/d" \
36 -e "/mp_fopen.c:.*where an off_t is 32-bits/d" \
37 -e "/mutex\/tm.c:/d" \
38 -e "/off_t because its size depends on/d" \
39 -e "/os_ext.h/d" \
40 -e "/os.h/d" \
41 -e "/os_flock.c/d" \
42 -e "/rep.h/d" \
43 -e "/zerofill.c:.*stat_offset/d" \
44 -e "/zerofill.c:.*write_offset/d" \
45 -e "/os_map.c:.*(off_t)0))/d" \
46 -e "/os_method.c/d" \
47 -e "/os_rw.c:/d" \
48 -e "/os_seek.c:.*off_t offset;/d" \
49 -e "/os_seek.c:.*offset = /d" \
50 -e "/os_seek.c:.*off_t/d" \
51 -e "/os_truncate.c:.*off_t offset;/d" \
52 -e "/os_truncate.c:.*off_t stat_offset;/d" \
53 -e "/os_truncate.c:.*offset = /d" \
54 -e "/test_perf\/perf_misc.c:/d" \
55 -e "/test_server\/dbs.c:/d" \
56 -e "/test_vxworks\/vx_mutex.c:/d" > $t
57
58 test -s $t && {
59 cat $t
60 echo "FAIL: found questionable off_t usage"
61 exit 1
62 }
63
64 rm -f $t
65
66 exit 0