Use S_IS*(), not S_IF*.
This commit is contained in:
parent
004f255040
commit
e8018f6da9
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: printjob.c,v 1.17 1997/10/05 16:45:45 mrg Exp $ */
|
||||
/* $NetBSD: printjob.c,v 1.18 1997/10/19 19:40:21 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
|
@ -45,7 +45,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: printjob.c,v 1.17 1997/10/05 16:45:45 mrg Exp $");
|
||||
__RCSID("$NetBSD: printjob.c,v 1.18 1997/10/19 19:40:21 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -539,7 +539,7 @@ print(format, file)
|
|||
* still point to the same file or someone is trying to print
|
||||
* something he shouldn't.
|
||||
*/
|
||||
if ((stb.st_mode & S_IFMT) == S_IFLNK && fstat(fi, &stb) == 0 &&
|
||||
if (S_ISLNK(stb.st_mode) && fstat(fi, &stb) == 0 &&
|
||||
(stb.st_dev != fdev || stb.st_ino != fino))
|
||||
return(ACCESS);
|
||||
if (!SF && !tof) { /* start on a fresh page */
|
||||
|
@ -862,7 +862,7 @@ sendfile(type, file)
|
|||
* still point to the same file or someone is trying to print something
|
||||
* he shouldn't.
|
||||
*/
|
||||
if ((stb.st_mode & S_IFMT) == S_IFLNK && fstat(f, &stb) == 0 &&
|
||||
if (S_ISLNK(stb.st_mode) && fstat(f, &stb) == 0 &&
|
||||
(stb.st_dev != fdev || stb.st_ino != fino))
|
||||
return(ACCESS);
|
||||
amt = snprintf(buf, sizeof(buf), "%c%qd %s\n", type,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lpr.c,v 1.15 1997/10/05 15:12:20 mrg Exp $ */
|
||||
/* $NetBSD: lpr.c,v 1.16 1997/10/19 19:41:57 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1989, 1993
|
||||
|
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)lpr.c 8.4 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: lpr.c,v 1.15 1997/10/05 15:12:20 mrg Exp $");
|
||||
__RCSID("$NetBSD: lpr.c,v 1.16 1997/10/19 19:41:57 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -606,7 +606,7 @@ test(file)
|
|||
printf("%s: cannot stat %s\n", name, file);
|
||||
goto bad;
|
||||
}
|
||||
if ((statb.st_mode & S_IFMT) == S_IFDIR) {
|
||||
if (S_ISDIR(statb.st_mode)) {
|
||||
printf("%s: %s is a directory\n", name, file);
|
||||
goto bad;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: parseconf.c,v 1.6 1997/10/18 11:23:07 lukem Exp $ */
|
||||
/* $NetBSD: parseconf.c,v 1.7 1997/10/19 19:43:45 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1992 The University of Utah and the Center
|
||||
|
@ -51,7 +51,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)parseconf.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: parseconf.c,v 1.6 1997/10/18 11:23:07 lukem Exp $");
|
||||
__RCSID("$NetBSD: parseconf.c,v 1.7 1997/10/19 19:43:45 mycroft Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -345,8 +345,7 @@ GetBootFiles()
|
|||
*/
|
||||
i = 0;
|
||||
for (dp = readdir(dfd); dp != NULL; dp = readdir(dfd)) {
|
||||
if (stat(dp->d_name, &statb) < 0 ||
|
||||
(statb.st_mode & S_IFMT) != S_IFREG)
|
||||
if (stat(dp->d_name, &statb) < 0 || !S_ISREG(statb.st_mode))
|
||||
continue;
|
||||
if (i == C_MAXFILE)
|
||||
syslog(LOG_ERR,
|
||||
|
|
Loading…
Reference in New Issue