Wed Oct 14 16:02:04 2015 UTC ()
this is syslog-like


(christos)
diff -r1.23 -r1.24 src/usr.sbin/lpr/lpd/recvjob.c

cvs diff -r1.23 -r1.24 src/usr.sbin/lpr/lpd/recvjob.c (expand / switch to unified diff)

--- src/usr.sbin/lpr/lpd/recvjob.c 2011/08/30 19:27:37 1.23
+++ src/usr.sbin/lpr/lpd/recvjob.c 2015/10/14 16:02:03 1.24
@@ -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
42static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 42static 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
71static char dfname[NAME_MAX]; /* data files */ 71static char dfname[NAME_MAX]; /* data files */
72static int minfree; /* keep at least minfree blocks available */ 72static int minfree; /* keep at least minfree blocks available */
73static const char *sp = ""; 73static const char *sp = "";
74static char tfname[NAME_MAX]; /* tmp copy of cf before linking */ 74static char tfname[NAME_MAX]; /* tmp copy of cf before linking */
75 75
76static int chksize(int); 76static int chksize(int);
77static void frecverr(const char *, ...) __dead __printflike(1, 2); 77static void frecverr(const char *, ...) __dead __sysloglike(1, 2);
78static int noresponse(void); 78static int noresponse(void);
79static void rcleanup(int); 79static void rcleanup(int);
80static int read_number(const char *); 80static int read_number(const char *);
81static int readfile(char *, int); 81static int readfile(char *, int);
82static int readjob(void); 82static int readjob(void);
83 83
84 84
85void 85void
86recvjob(void) 86recvjob(void)
87{ 87{
88 struct stat stb; 88 struct stat stb;
89 int fd; 89 int fd;
90 90