From 2e1938f076c03ba21731ed8299cf04d2cb383666 Mon Sep 17 00:00:00 2001 From: jb Date: Fri, 9 Jan 1998 06:14:59 +0000 Subject: Make a couple of the stat flags dependent on the sys/stat.h header file that this source is compiled against. This source is referenced by install which is needed as a build tool and must be able to compile against NetBSD headers and libraries if we have a hope of supporting another architecture. With this change, that's two working programs down and 3945 (?) to go. The other one was make, but that didn't need any changes to work under FreeBSD/Alpha. 8-) --- lib/libc/gen/setflags.c | 10 +++++++++- lib/libc/gen/setflagsbyname.c | 10 +++++++++- lib/libc/gen/strtofflags.c | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/gen/setflags.c b/lib/libc/gen/setflags.c index 775bcd7..1f22f5a 100644 --- a/lib/libc/gen/setflags.c +++ b/lib/libc/gen/setflags.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)stat_flags.c 8.1 (Berkeley) 5/31/93"; #else static const char rcsid[] = - "$Id: stat_flags.c,v 1.7 1997/08/07 15:33:49 steve Exp $"; + "$Id: stat_flags.c,v 1.8 1997/08/07 22:28:25 steve Exp $"; #endif #endif /* not lint */ @@ -72,8 +72,10 @@ flags_to_string(flags, def) SAPPEND("uappnd"); if (flags & UF_IMMUTABLE) SAPPEND("uchg"); +#ifdef UF_NOUNLINK if (flags & UF_NOUNLINK) SAPPEND("uunlnk"); +#endif if (flags & UF_NODUMP) SAPPEND("nodump"); if (flags & UF_OPAQUE) @@ -84,8 +86,10 @@ flags_to_string(flags, def) SAPPEND("arch"); if (flags & SF_IMMUTABLE) SAPPEND("schg"); +#ifdef SF_NOUNLINK if (flags & SF_NOUNLINK) SAPPEND("sunlnk"); +#endif return (prefix == NULL && def != NULL ? def : string); } @@ -146,8 +150,10 @@ string_to_flags(stringp, setp, clrp) TEST(p, "schg", SF_IMMUTABLE); TEST(p, "schange", SF_IMMUTABLE); TEST(p, "simmutable", SF_IMMUTABLE); +#ifdef SF_NOUNLINK TEST(p, "sunlnk", SF_NOUNLINK); TEST(p, "sunlink", SF_NOUNLINK); +#endif return (1); case 'u': TEST(p, "uappnd", UF_APPEND); @@ -155,8 +161,10 @@ string_to_flags(stringp, setp, clrp) TEST(p, "uchg", UF_IMMUTABLE); TEST(p, "uchange", UF_IMMUTABLE); TEST(p, "uimmutable", UF_IMMUTABLE); +#ifdef UF_NOUNLINK TEST(p, "uunlnk", UF_NOUNLINK); TEST(p, "uunlink", UF_NOUNLINK); +#endif /* FALLTHROUGH */ default: return (1); diff --git a/lib/libc/gen/setflagsbyname.c b/lib/libc/gen/setflagsbyname.c index 775bcd7..1f22f5a 100644 --- a/lib/libc/gen/setflagsbyname.c +++ b/lib/libc/gen/setflagsbyname.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)stat_flags.c 8.1 (Berkeley) 5/31/93"; #else static const char rcsid[] = - "$Id: stat_flags.c,v 1.7 1997/08/07 15:33:49 steve Exp $"; + "$Id: stat_flags.c,v 1.8 1997/08/07 22:28:25 steve Exp $"; #endif #endif /* not lint */ @@ -72,8 +72,10 @@ flags_to_string(flags, def) SAPPEND("uappnd"); if (flags & UF_IMMUTABLE) SAPPEND("uchg"); +#ifdef UF_NOUNLINK if (flags & UF_NOUNLINK) SAPPEND("uunlnk"); +#endif if (flags & UF_NODUMP) SAPPEND("nodump"); if (flags & UF_OPAQUE) @@ -84,8 +86,10 @@ flags_to_string(flags, def) SAPPEND("arch"); if (flags & SF_IMMUTABLE) SAPPEND("schg"); +#ifdef SF_NOUNLINK if (flags & SF_NOUNLINK) SAPPEND("sunlnk"); +#endif return (prefix == NULL && def != NULL ? def : string); } @@ -146,8 +150,10 @@ string_to_flags(stringp, setp, clrp) TEST(p, "schg", SF_IMMUTABLE); TEST(p, "schange", SF_IMMUTABLE); TEST(p, "simmutable", SF_IMMUTABLE); +#ifdef SF_NOUNLINK TEST(p, "sunlnk", SF_NOUNLINK); TEST(p, "sunlink", SF_NOUNLINK); +#endif return (1); case 'u': TEST(p, "uappnd", UF_APPEND); @@ -155,8 +161,10 @@ string_to_flags(stringp, setp, clrp) TEST(p, "uchg", UF_IMMUTABLE); TEST(p, "uchange", UF_IMMUTABLE); TEST(p, "uimmutable", UF_IMMUTABLE); +#ifdef UF_NOUNLINK TEST(p, "uunlnk", UF_NOUNLINK); TEST(p, "uunlink", UF_NOUNLINK); +#endif /* FALLTHROUGH */ default: return (1); diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c index 775bcd7..1f22f5a 100644 --- a/lib/libc/gen/strtofflags.c +++ b/lib/libc/gen/strtofflags.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)stat_flags.c 8.1 (Berkeley) 5/31/93"; #else static const char rcsid[] = - "$Id: stat_flags.c,v 1.7 1997/08/07 15:33:49 steve Exp $"; + "$Id: stat_flags.c,v 1.8 1997/08/07 22:28:25 steve Exp $"; #endif #endif /* not lint */ @@ -72,8 +72,10 @@ flags_to_string(flags, def) SAPPEND("uappnd"); if (flags & UF_IMMUTABLE) SAPPEND("uchg"); +#ifdef UF_NOUNLINK if (flags & UF_NOUNLINK) SAPPEND("uunlnk"); +#endif if (flags & UF_NODUMP) SAPPEND("nodump"); if (flags & UF_OPAQUE) @@ -84,8 +86,10 @@ flags_to_string(flags, def) SAPPEND("arch"); if (flags & SF_IMMUTABLE) SAPPEND("schg"); +#ifdef SF_NOUNLINK if (flags & SF_NOUNLINK) SAPPEND("sunlnk"); +#endif return (prefix == NULL && def != NULL ? def : string); } @@ -146,8 +150,10 @@ string_to_flags(stringp, setp, clrp) TEST(p, "schg", SF_IMMUTABLE); TEST(p, "schange", SF_IMMUTABLE); TEST(p, "simmutable", SF_IMMUTABLE); +#ifdef SF_NOUNLINK TEST(p, "sunlnk", SF_NOUNLINK); TEST(p, "sunlink", SF_NOUNLINK); +#endif return (1); case 'u': TEST(p, "uappnd", UF_APPEND); @@ -155,8 +161,10 @@ string_to_flags(stringp, setp, clrp) TEST(p, "uchg", UF_IMMUTABLE); TEST(p, "uchange", UF_IMMUTABLE); TEST(p, "uimmutable", UF_IMMUTABLE); +#ifdef UF_NOUNLINK TEST(p, "uunlnk", UF_NOUNLINK); TEST(p, "uunlink", UF_NOUNLINK); +#endif /* FALLTHROUGH */ default: return (1); -- cgit v1.1