printjob.c (24831) | printjob.c (27635) |
---|---|
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: --- 639 unchanged lines hidden (view full) --- 648 } 649 if (prog == NULL) { 650 (void) close(fi); 651 syslog(LOG_ERR, 652 "%s: no filter found in printcap for format character '%c'", 653 printer, format); 654 return(ERROR); 655 } | 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: --- 639 unchanged lines hidden (view full) --- 648 } 649 if (prog == NULL) { 650 (void) close(fi); 651 syslog(LOG_ERR, 652 "%s: no filter found in printcap for format character '%c'", 653 printer, format); 654 return(ERROR); 655 } |
656 if ((av[0] = rindex(prog, '/')) != NULL) | 656 if ((av[0] = strrchr(prog, '/')) != NULL) |
657 av[0]++; 658 else 659 av[0] = prog; 660 av[n++] = "-n"; 661 av[n++] = logname; 662 av[n++] = "-h"; 663 av[n++] = fromhost; 664 av[n++] = AF; --- 212 unchanged lines hidden (view full) --- 877 int ifilter; 878 union wait status; 879 880 strcpy(tfile,TFILENAME); 881 if ((tfd = mkstemp(tfile)) == -1) { 882 syslog(LOG_ERR, "mkstemp: %m"); 883 return(ERROR); 884 } | 657 av[0]++; 658 else 659 av[0] = prog; 660 av[n++] = "-n"; 661 av[n++] = logname; 662 av[n++] = "-h"; 663 av[n++] = fromhost; 664 av[n++] = AF; --- 212 unchanged lines hidden (view full) --- 877 int ifilter; 878 union wait status; 879 880 strcpy(tfile,TFILENAME); 881 if ((tfd = mkstemp(tfile)) == -1) { 882 syslog(LOG_ERR, "mkstemp: %m"); 883 return(ERROR); 884 } |
885 if ((av[0] = rindex(IF, '/')) == NULL) | 885 if ((av[0] = strrchr(IF, '/')) == NULL) |
886 av[0] = IF; 887 else 888 av[0]++; 889 if (format == 'l') 890 av[n=1] = "-c"; 891 else 892 n = 0; 893 av[++n] = width; --- 294 unchanged lines hidden (view full) --- 1188 FILE *fp; 1189 1190 pipe(p); 1191 if ((s = dofork(DORETURN)) == 0) { /* child */ 1192 dup2(p[0], 0); 1193 closelog(); 1194 for (i = 3, dtablesize = getdtablesize(); i < dtablesize; i++) 1195 (void) close(i); | 886 av[0] = IF; 887 else 888 av[0]++; 889 if (format == 'l') 890 av[n=1] = "-c"; 891 else 892 n = 0; 893 av[++n] = width; --- 294 unchanged lines hidden (view full) --- 1188 FILE *fp; 1189 1190 pipe(p); 1191 if ((s = dofork(DORETURN)) == 0) { /* child */ 1192 dup2(p[0], 0); 1193 closelog(); 1194 for (i = 3, dtablesize = getdtablesize(); i < dtablesize; i++) 1195 (void) close(i); |
1196 if ((cp = rindex(_PATH_SENDMAIL, '/')) != NULL) | 1196 if ((cp = strrchr(_PATH_SENDMAIL, '/')) != NULL) |
1197 cp++; 1198 else 1199 cp = _PATH_SENDMAIL; 1200 sprintf(buf, "%s@%s", user, fromhost); 1201 execl(_PATH_SENDMAIL, cp, buf, 0); 1202 exit(0); 1203 } else if (s > 0) { /* parent */ 1204 dup2(p[1], 1); --- 175 unchanged lines hidden (view full) --- 1380static void 1381openpr() 1382{ 1383 register int i; 1384 int dtablesize; 1385 char *cp; 1386 1387 if (!remote && *LP) { | 1197 cp++; 1198 else 1199 cp = _PATH_SENDMAIL; 1200 sprintf(buf, "%s@%s", user, fromhost); 1201 execl(_PATH_SENDMAIL, cp, buf, 0); 1202 exit(0); 1203 } else if (s > 0) { /* parent */ 1204 dup2(p[1], 1); --- 175 unchanged lines hidden (view full) --- 1380static void 1381openpr() 1382{ 1383 register int i; 1384 int dtablesize; 1385 char *cp; 1386 1387 if (!remote && *LP) { |
1388 if (cp = index(LP, '@')) | 1388 if (cp = strchr(LP, '@')) |
1389 opennet(cp); 1390 else 1391 opentty(); 1392 } else if (remote) { 1393 openrem(); 1394 } else { 1395 syslog(LOG_ERR, "%s: no line printer device or host name", 1396 printer); --- 14 unchanged lines hidden (view full) --- 1411 if ((ofilter = dofork(DOABORT)) == 0) { /* child */ 1412 dup2(p[0], 0); /* pipe is std in */ 1413 /* tfile/printer is stdout */ 1414 dup2(remote ? tfd : pfd, 1); 1415 closelog(); 1416 for (i = 3, dtablesize = getdtablesize(); 1417 i < dtablesize; i++) 1418 (void) close(i); | 1389 opennet(cp); 1390 else 1391 opentty(); 1392 } else if (remote) { 1393 openrem(); 1394 } else { 1395 syslog(LOG_ERR, "%s: no line printer device or host name", 1396 printer); --- 14 unchanged lines hidden (view full) --- 1411 if ((ofilter = dofork(DOABORT)) == 0) { /* child */ 1412 dup2(p[0], 0); /* pipe is std in */ 1413 /* tfile/printer is stdout */ 1414 dup2(remote ? tfd : pfd, 1); 1415 closelog(); 1416 for (i = 3, dtablesize = getdtablesize(); 1417 i < dtablesize; i++) 1418 (void) close(i); |
1419 if ((cp = rindex(OF, '/')) == NULL) | 1419 if ((cp = strrchr(OF, '/')) == NULL) |
1420 cp = OF; 1421 else 1422 cp++; 1423 execl(OF, cp, width, length, 0); 1424 syslog(LOG_ERR, "%s: %s: %m", printer, OF); 1425 exit(1); 1426 } 1427 (void) close(p[0]); /* close input side */ --- 218 unchanged lines hidden --- | 1420 cp = OF; 1421 else 1422 cp++; 1423 execl(OF, cp, width, length, 0); 1424 syslog(LOG_ERR, "%s: %s: %m", printer, OF); 1425 exit(1); 1426 } 1427 (void) close(p[0]); /* close input side */ --- 218 unchanged lines hidden --- |