Deleted Added
full compact
recvjob.c (117587) recvjob.c (118881)
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 31 unchanged lines hidden (view full) ---

40
41#if 0
42#ifndef lint
43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
44#endif /* not lint */
45#endif
46
47#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 31 unchanged lines hidden (view full) ---

40
41#if 0
42#ifndef lint
43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
44#endif /* not lint */
45#endif
46
47#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
48__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 117587 2003-07-14 19:59:33Z gad $");
48__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 118881 2003-08-13 20:31:33Z gad $");
49
50/*
51 * Receive printer jobs from the network, queue them and
52 * start the printer daemon.
53 */
54#include <sys/param.h>
55#include <sys/mount.h>
56#include <sys/stat.h>

--- 49 unchanged lines hidden (view full) ---

106 frecverr("unknown printer %s", printer);
107 break;
108 case PCAPERR_TCLOOP:
109 fatal(pp, "potential reference loop detected in printcap file");
110 default:
111 break;
112 }
113
49
50/*
51 * Receive printer jobs from the network, queue them and
52 * start the printer daemon.
53 */
54#include <sys/param.h>
55#include <sys/mount.h>
56#include <sys/stat.h>

--- 49 unchanged lines hidden (view full) ---

106 frecverr("unknown printer %s", printer);
107 break;
108 case PCAPERR_TCLOOP:
109 fatal(pp, "potential reference loop detected in printcap file");
110 default:
111 break;
112 }
113
114 (void) close(2); /* set up log file */
114 (void) close(STDERR_FILENO); /* set up log file */
115 if (open(pp->log_file, O_WRONLY|O_APPEND, 0664) < 0) {
116 syslog(LOG_ERR, "%s: %m", pp->log_file);
117 (void) open(_PATH_DEVNULL, O_WRONLY);
118 }
119
120 if (chdir(pp->spool_dir) < 0)
121 frecverr("%s: chdir(%s): %s", pp->printer, pp->spool_dir,
122 strerror(errno));

--- 282 unchanged lines hidden ---
115 if (open(pp->log_file, O_WRONLY|O_APPEND, 0664) < 0) {
116 syslog(LOG_ERR, "%s: %m", pp->log_file);
117 (void) open(_PATH_DEVNULL, O_WRONLY);
118 }
119
120 if (chdir(pp->spool_dir) < 0)
121 frecverr("%s: chdir(%s): %s", pp->printer, pp->spool_dir,
122 strerror(errno));

--- 282 unchanged lines hidden ---