From f1d896d1177b2b01d5157bcfa843e2bf4911d48d Mon Sep 17 00:00:00 2001 From: John Birrell Date: Fri, 9 Jan 1998 06:14:59 +0000 Subject: [PATCH] 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-) --- bin/ls/stat_flags.c | 10 +++++++++- lib/libc/gen/setflags.c | 10 +++++++++- lib/libc/gen/setflagsbyname.c | 10 +++++++++- lib/libc/gen/strtofflags.c | 10 +++++++++- lib/libutil/stat_flags.c | 10 +++++++++- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/bin/ls/stat_flags.c b/bin/ls/stat_flags.c index 775bcd725b4..1f22f5a8ad9 100644 --- a/bin/ls/stat_flags.c +++ b/bin/ls/stat_flags.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/setflags.c b/lib/libc/gen/setflags.c index 775bcd725b4..1f22f5a8ad9 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 775bcd725b4..1f22f5a8ad9 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 775bcd725b4..1f22f5a8ad9 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); diff --git a/lib/libutil/stat_flags.c b/lib/libutil/stat_flags.c index 775bcd725b4..1f22f5a8ad9 100644 --- a/lib/libutil/stat_flags.c +++ b/lib/libutil/stat_flags.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);