| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: recvjob.c,v 1.23 2011/08/30 19:27:37 joerg Exp $ */ | | 1 | /* $NetBSD: recvjob.c,v 1.24 2015/10/14 16:02:03 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1983, 1993 | | 4 | * Copyright (c) 1983, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -31,27 +31,27 @@ | | | @@ -31,27 +31,27 @@ |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | | | 34 | |
35 | #ifndef lint | | 35 | #ifndef lint |
36 | __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ | | 36 | __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ |
37 | The Regents of the University of California. All rights reserved."); | | 37 | The Regents of the University of California. All rights reserved."); |
38 | #endif /* not lint */ | | 38 | #endif /* not lint */ |
39 | | | 39 | |
40 | #ifndef lint | | 40 | #ifndef lint |
41 | #if 0 | | 41 | #if 0 |
42 | static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; | | 42 | static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; |
43 | #else | | 43 | #else |
44 | __RCSID("$NetBSD: recvjob.c,v 1.23 2011/08/30 19:27:37 joerg Exp $"); | | 44 | __RCSID("$NetBSD: recvjob.c,v 1.24 2015/10/14 16:02:03 christos Exp $"); |
45 | #endif | | 45 | #endif |
46 | #endif /* not lint */ | | 46 | #endif /* not lint */ |
47 | | | 47 | |
48 | /* | | 48 | /* |
49 | * Receive printer jobs from the network, queue them and | | 49 | * Receive printer jobs from the network, queue them and |
50 | * start the printer daemon. | | 50 | * start the printer daemon. |
51 | */ | | 51 | */ |
52 | #include <sys/param.h> | | 52 | #include <sys/param.h> |
53 | #include <sys/mount.h> | | 53 | #include <sys/mount.h> |
54 | #include <sys/stat.h> | | 54 | #include <sys/stat.h> |
55 | | | 55 | |
56 | #include <unistd.h> | | 56 | #include <unistd.h> |
57 | #include <signal.h> | | 57 | #include <signal.h> |
| @@ -64,27 +64,27 @@ __RCSID("$NetBSD: recvjob.c,v 1.23 2011/ | | | @@ -64,27 +64,27 @@ __RCSID("$NetBSD: recvjob.c,v 1.23 2011/ |
64 | #include "lp.h" | | 64 | #include "lp.h" |
65 | #include "lp.local.h" | | 65 | #include "lp.local.h" |
66 | #include "extern.h" | | 66 | #include "extern.h" |
67 | #include "pathnames.h" | | 67 | #include "pathnames.h" |
68 | | | 68 | |
69 | #define ack() (void)write(STDOUT_FILENO, sp, 1); | | 69 | #define ack() (void)write(STDOUT_FILENO, sp, 1); |
70 | | | 70 | |
71 | static char dfname[NAME_MAX]; /* data files */ | | 71 | static char dfname[NAME_MAX]; /* data files */ |
72 | static int minfree; /* keep at least minfree blocks available */ | | 72 | static int minfree; /* keep at least minfree blocks available */ |
73 | static const char *sp = ""; | | 73 | static const char *sp = ""; |
74 | static char tfname[NAME_MAX]; /* tmp copy of cf before linking */ | | 74 | static char tfname[NAME_MAX]; /* tmp copy of cf before linking */ |
75 | | | 75 | |
76 | static int chksize(int); | | 76 | static int chksize(int); |
77 | static void frecverr(const char *, ...) __dead __printflike(1, 2); | | 77 | static void frecverr(const char *, ...) __dead __sysloglike(1, 2); |
78 | static int noresponse(void); | | 78 | static int noresponse(void); |
79 | static void rcleanup(int); | | 79 | static void rcleanup(int); |
80 | static int read_number(const char *); | | 80 | static int read_number(const char *); |
81 | static int readfile(char *, int); | | 81 | static int readfile(char *, int); |
82 | static int readjob(void); | | 82 | static int readjob(void); |
83 | | | 83 | |
84 | | | 84 | |
85 | void | | 85 | void |
86 | recvjob(void) | | 86 | recvjob(void) |
87 | { | | 87 | { |
88 | struct stat stb; | | 88 | struct stat stb; |
89 | int fd; | | 89 | int fd; |
90 | | | 90 | |