mirror of https://github.com/getdnsapi/getdns.git
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
# #-- 070-coding-practice.test --#
|
|
# source the master var file when it's there
|
|
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
|
|
# use .tpkg.var.test for in test variable passing
|
|
[ -f .tpkg.var.test ] && source .tpkg.var.test
|
|
|
|
rm -f report.txt
|
|
(
|
|
cd ${SRCROOT}/src
|
|
if [ `grep '[^!=]=[ ][ ]*NET_REQ_' *.[ch] */*.[ch] | wc -l` -gt 1 ]
|
|
then
|
|
echo "*** "
|
|
echo "*** Setting getdns_network_req->state should be done via"
|
|
echo "*** _getdns_netreq_change_state() only, for anticipating"
|
|
echo "*** running out of filedescriptors (sockets) and for the"
|
|
echo "*** limit_outstanding_queries feature."
|
|
echo "*** "
|
|
grep -n '[^!=]=[ ][ ]*NET_REQ_' *.[ch] */*.[ch] | \
|
|
grep -v '^request-internal.c:[12][0-9][0-9]: *net_req->state = NET_REQ_NOT_SENT;$'
|
|
echo ""
|
|
fi
|
|
) >> report.txt
|
|
(
|
|
cd ${SRCROOT}/src
|
|
if [ `grep '__FUNCTION__' *.[ch] */*.[ch] | wc -l` -gt 0 ]
|
|
then
|
|
echo "*** "
|
|
echo "*** Use __FUNC__ instead of __FUNCTION__ for portability"
|
|
echo "*** __FUNC__ is aliases in config.h to name to be used"
|
|
echo "*** for the system with a #define"
|
|
echo "*** "
|
|
grep -n '__FUNCTION__' *.[ch] */*.[ch]
|
|
echo ""
|
|
fi
|
|
) >> report.txt
|
|
|
|
if [ -s report.txt ]
|
|
then
|
|
cat report.txt
|
|
false
|
|
fi
|