printjob.c (94040) | printjob.c (95067) |
---|---|
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: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42/* 43static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95"; 44*/ 45static const char rcsid[] = | 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: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42/* 43static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95"; 44*/ 45static const char rcsid[] = |
46 "$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 94040 2002-04-07 08:12:39Z gad $"; | 46 "$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 95067 2002-04-19 18:28:35Z gad $"; |
47#endif /* not lint */ 48 49 50/* 51 * printjob -- print jobs in the queue. 52 * 53 * NOTE: the lock file is used to pass information to lpq and lprm. 54 * it does not need to be removed because file locks are dynamic. --- 748 unchanged lines hidden (view full) --- 803 /* setup stderr for the filter (child process) 804 * so it goes to our temporary errors file */ 805 n = open(tempstderr, O_WRONLY|O_TRUNC, 0664); 806 if (n >= 0) 807 dup2(n, 2); 808 closelog(); 809 closeallfds(3); 810 execv(prog, av); | 47#endif /* not lint */ 48 49 50/* 51 * printjob -- print jobs in the queue. 52 * 53 * NOTE: the lock file is used to pass information to lpq and lprm. 54 * it does not need to be removed because file locks are dynamic. --- 748 unchanged lines hidden (view full) --- 803 /* setup stderr for the filter (child process) 804 * so it goes to our temporary errors file */ 805 n = open(tempstderr, O_WRONLY|O_TRUNC, 0664); 806 if (n >= 0) 807 dup2(n, 2); 808 closelog(); 809 closeallfds(3); 810 execv(prog, av); |
811 syslog(LOG_ERR, "cannot execv %s", prog); | 811 syslog(LOG_ERR, "%s: cannot execv(%s): %m", pp->printer, 812 prog); |
812 exit(2); 813 } 814 (void) close(fi); 815 if (child < 0) 816 status.w_retcode = 100; 817 else { 818 while ((pid = wait((int *)&status)) > 0 && pid != child) 819 ; --- 419 unchanged lines hidden (view full) --- 1239 dup2(infd, 0); 1240 dup2(outfd, 1); 1241 errfd = open(tempstderr, O_WRONLY|O_TRUNC, 0664); 1242 if (errfd >= 0) 1243 dup2(errfd, 2); 1244 closelog(); 1245 closeallfds(3); 1246 execv(f_cmd, f_av); | 813 exit(2); 814 } 815 (void) close(fi); 816 if (child < 0) 817 status.w_retcode = 100; 818 else { 819 while ((pid = wait((int *)&status)) > 0 && pid != child) 820 ; --- 419 unchanged lines hidden (view full) --- 1240 dup2(infd, 0); 1241 dup2(outfd, 1); 1242 errfd = open(tempstderr, O_WRONLY|O_TRUNC, 0664); 1243 if (errfd >= 0) 1244 dup2(errfd, 2); 1245 closelog(); 1246 closeallfds(3); 1247 execv(f_cmd, f_av); |
1247 syslog(LOG_ERR, "%s: cannot execv %s", pp->printer, f_cmd); | 1248 syslog(LOG_ERR, "%s: cannot execv(%s): %m", pp->printer, f_cmd); |
1248 exit(2); 1249 /* NOTREACHED */ 1250} 1251 1252/* 1253 * Check to make sure there have been no errors and that both programs 1254 * are in sync with eachother. 1255 * Return non-zero if the connection was lost. --- 601 unchanged lines hidden --- | 1249 exit(2); 1250 /* NOTREACHED */ 1251} 1252 1253/* 1254 * Check to make sure there have been no errors and that both programs 1255 * are in sync with eachother. 1256 * Return non-zero if the connection was lost. --- 601 unchanged lines hidden --- |