printjob.c (94038) | printjob.c (94040) |
---|---|
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 94038 2002-04-07 08:01:42Z gad $"; | 46 "$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 94040 2002-04-07 08:12:39Z 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. --- 1347 unchanged lines hidden (view full) --- 1402 dup2(p[1], 1); 1403 printf("To: %s@%s\n", userid, origin_host); 1404 printf("Subject: %s printer job \"%s\"\n", pp->printer, 1405 *jobname ? jobname : "<unknown>"); 1406 printf("Reply-To: root@%s\n\n", local_host); 1407 printf("Your printer job "); 1408 if (*jobname) 1409 printf("(%s) ", jobname); | 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. --- 1347 unchanged lines hidden (view full) --- 1402 dup2(p[1], 1); 1403 printf("To: %s@%s\n", userid, origin_host); 1404 printf("Subject: %s printer job \"%s\"\n", pp->printer, 1405 *jobname ? jobname : "<unknown>"); 1406 printf("Reply-To: root@%s\n\n", local_host); 1407 printf("Your printer job "); 1408 if (*jobname) 1409 printf("(%s) ", jobname); |
1410 1411 cp = "XXX compiler confusion"; /* XXX shut GCC up */ | 1410 |
1412 switch (bombed) { 1413 case OK: | 1411 switch (bombed) { 1412 case OK: |
1414 printf("\ncompleted successfully\n"); | |
1415 cp = "OK"; | 1413 cp = "OK"; |
1414 printf("\ncompleted successfully\n"); |
|
1416 break; 1417 default: 1418 case FATALERR: | 1415 break; 1416 default: 1417 case FATALERR: |
1419 printf("\ncould not be printed\n"); | |
1420 cp = "FATALERR"; | 1418 cp = "FATALERR"; |
1419 printf("\ncould not be printed\n"); |
|
1421 break; 1422 case NOACCT: | 1420 break; 1421 case NOACCT: |
1422 cp = "NOACCT"; |
|
1423 printf("\ncould not be printed without an account on %s\n", 1424 local_host); | 1423 printf("\ncould not be printed without an account on %s\n", 1424 local_host); |
1425 cp = "NOACCT"; | |
1426 break; 1427 case FILTERERR: | 1425 break; 1426 case FILTERERR: |
1427 cp = "FILTERERR"; |
|
1428 if (stat(tempstderr, &stb) < 0 || stb.st_size == 0 1429 || (fp = fopen(tempstderr, "r")) == NULL) { 1430 printf("\nhad some errors and may not have printed\n"); 1431 break; 1432 } 1433 printf("\nhad the following errors and may not have printed:\n"); 1434 while ((i = getc(fp)) != EOF) 1435 putchar(i); 1436 (void) fclose(fp); | 1428 if (stat(tempstderr, &stb) < 0 || stb.st_size == 0 1429 || (fp = fopen(tempstderr, "r")) == NULL) { 1430 printf("\nhad some errors and may not have printed\n"); 1431 break; 1432 } 1433 printf("\nhad the following errors and may not have printed:\n"); 1434 while ((i = getc(fp)) != EOF) 1435 putchar(i); 1436 (void) fclose(fp); |
1437 cp = "FILTERERR"; | |
1438 break; 1439 case ACCESS: | 1437 break; 1438 case ACCESS: |
1440 printf("\nwas not printed because it was not linked to the original file\n"); | |
1441 cp = "ACCESS"; | 1439 cp = "ACCESS"; |
1440 printf("\nwas not printed because it was not linked to the original file\n"); |
|
1442 } 1443 fflush(stdout); 1444 (void) close(1); 1445 } else { 1446 syslog(LOG_WARNING, "unable to send mail to %s: %m", userid); 1447 return; 1448 } 1449 (void) close(p[0]); --- 408 unchanged lines hidden --- | 1441 } 1442 fflush(stdout); 1443 (void) close(1); 1444 } else { 1445 syslog(LOG_WARNING, "unable to send mail to %s: %m", userid); 1446 return; 1447 } 1448 (void) close(p[0]); --- 408 unchanged lines hidden --- |