8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / lp / lib / requests / anyrequests.c
blobec61529c54f84a21f918aca7b503bacbaad93f36
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 /* All Rights Reserved */
26 #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */
27 /* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */
29 #include "sys/types.h"
31 #include "lp.h"
33 /**
34 ** anyrequests() - SEE IF ANY REQUESTS ARE ``QUEUED''
35 **/
37 int
38 #if defined(__STDC__)
39 anyrequests (
40 void
42 #else
43 anyrequests ()
44 #endif
46 long lastdir = -1;
48 char * name;
52 * This routine walks through the requests (secure)
53 * directory looking for files, descending one level
54 * into each sub-directory, if any. Finding at least
55 * one file means that a request is queued.
57 while ((name = next_dir(Lp_Requests, &lastdir))) {
59 long lastfile = -1;
61 char * subdir;
64 if (!(subdir = makepath(Lp_Requests, name, (char *)0)))
65 return (1); /* err on safe side */
67 if (next_file(subdir, &lastfile)) {
68 Free (subdir);
69 return (1);
72 Free (subdir);
74 return (0);