printjob.c (216372) | printjob.c (228664) |
---|---|
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: --- 27 unchanged lines hidden (view full) --- 36 37#if 0 38#ifndef lint 39static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95"; 40#endif /* not lint */ 41#endif 42 43#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: --- 27 unchanged lines hidden (view full) --- 36 37#if 0 38#ifndef lint 39static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95"; 40#endif /* not lint */ 41#endif 42 43#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ |
44__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 216372 2010-12-11 09:38:12Z joel $"); | 44__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 228664 2011-12-17 22:05:28Z dim $"); |
45 46/* 47 * printjob -- print jobs in the queue. 48 * 49 * NOTE: the lock file is used to pass information to lpq and lprm. 50 * it does not need to be removed because file locks are dynamic. 51 */ 52 --- 4 unchanged lines hidden (view full) --- 57 58#include <pwd.h> 59#include <unistd.h> 60#include <signal.h> 61#include <syslog.h> 62#include <fcntl.h> 63#include <dirent.h> 64#include <errno.h> | 45 46/* 47 * printjob -- print jobs in the queue. 48 * 49 * NOTE: the lock file is used to pass information to lpq and lprm. 50 * it does not need to be removed because file locks are dynamic. 51 */ 52 --- 4 unchanged lines hidden (view full) --- 57 58#include <pwd.h> 59#include <unistd.h> 60#include <signal.h> 61#include <syslog.h> 62#include <fcntl.h> 63#include <dirent.h> 64#include <errno.h> |
65#include <inttypes.h> |
|
65#include <stdio.h> 66#include <string.h> 67#include <stdlib.h> 68#include <sys/ioctl.h> 69#include <termios.h> 70#include <time.h> 71#include "lp.h" 72#include "lp.local.h" --- 1060 unchanged lines hidden (view full) --- 1133 lseek(sfd, 0, SEEK_SET); 1134 } 1135 1136 copycnt = 0; 1137sendagain: 1138 copycnt++; 1139 1140 if (copycnt < 2) | 66#include <stdio.h> 67#include <string.h> 68#include <stdlib.h> 69#include <sys/ioctl.h> 70#include <termios.h> 71#include <time.h> 72#include "lp.h" 73#include "lp.local.h" --- 1060 unchanged lines hidden (view full) --- 1134 lseek(sfd, 0, SEEK_SET); 1135 } 1136 1137 copycnt = 0; 1138sendagain: 1139 copycnt++; 1140 1141 if (copycnt < 2) |
1141 (void) sprintf(buf, "%c%qd %s\n", type, stb.st_size, file); | 1142 (void) sprintf(buf, "%c%" PRId64 " %s\n", type, stb.st_size, 1143 file); |
1142 else | 1144 else |
1143 (void) sprintf(buf, "%c%qd %s_c%d\n", type, stb.st_size, | 1145 (void) sprintf(buf, "%c%" PRId64 " %s_c%d\n", type, stb.st_size, |
1144 file, copycnt); 1145 amt = strlen(buf); 1146 for (i = 0; ; i++) { 1147 if (write(pfd, buf, amt) != amt || 1148 (resp = response(pp)) < 0 || resp == '\1') { 1149 sfres = REPRINT; 1150 goto return_sfres; 1151 } else if (resp == '\0') --- 866 unchanged lines hidden --- | 1146 file, copycnt); 1147 amt = strlen(buf); 1148 for (i = 0; ; i++) { 1149 if (write(pfd, buf, amt) != amt || 1150 (resp = response(pp)) < 0 || resp == '\1') { 1151 sfres = REPRINT; 1152 goto return_sfres; 1153 } else if (resp == '\0') --- 866 unchanged lines hidden --- |