summaryrefslogtreecommitdiff
path: root/mcon/U/d_brokstat.U
blob: e82ad4bf57dbe636877f5539d32526de55ccf437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: d_brokstat.U,v $
?RCS: Revision 3.0.1.1  1997/02/28  15:30:53  ram
?RCS: patch61: created
?RCS:
?MAKE:d_brokstat: cat contains cppstdin cppminus +cppflags rm Setvar
?MAKE:	-pick add $@ %<
?S:d_brokstat:
?S:	This variable conditionally defines STAT_MACROS_BROKEN if some
?S:	of the S_IS*() macros from <sys/stat.h> give false positive on
?S:	regular files.
?S:.
?C:STAT_MACROS_BROKEN:
?C:	This symbol, if defined, indicates that the S_IS*() stat macros
?C:	such as S_ISBLK() give false positive and are thus unusable.
?C:	Your best bet is then to supply your own set.
?C:.
?H:#$d_brokstat STAT_MACROS_BROKEN 	/**/
?H:.
?F:!try.c !try
?LINT:set d_brokstat
?LINT:usefile try
?X: This test inspired by autoconf -- RAM, 28/02/97
: are stat macros sane?
echo " "
echo "Checking whether your stat() macros are broken..."
$cat >try.c <<EOC
#include <sys/types.h>
#include <sys/stat.h>

#if defined(S_ISBLK) && defined(S_IFDIR)
#if S_ISBLK(S_IFDIR)
Broken
#endif
#endif

#if defined(S_ISBLK) && defined(S_IFCHR)
#if S_ISBLK(S_IFCHR)
Broken
#endif
#endif

#if defined(S_ISLNK) && defined(S_IFREG)
#if S_ISLNK(S_IFREG)
Broken.
#endif
#endif

#if defined(S_ISSOCK) && defined(S_IFREG)
#if S_ISSOCK(S_IFREG)
Broken.
#endif
#endif
EOC
$cppstdin $cppflags $cppminus <try.c 2>/dev/null >try
if $contains Broken try >/dev/null 2>&1; then
	echo "Alas, they are.  I'll use my own macro set then." >&4
	val="$define"
else
	echo "Nope, working just fine." >&4
	val="$undef"
fi
$rm -f try try.c
set d_brokstat
eval $setvar