summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
16afe48)
SCCS-vsn: usr.sbin/lpr/lpr/lpr.c 4.17
SCCS-vsn: usr.sbin/lpr/common_source/rmjob.c 4.3
SCCS-vsn: usr.sbin/lpr/common_source/common.c 4.3
SCCS-vsn: usr.sbin/lpr/lpd/printjob.c 4.3
-/* common.c 4.2 83/05/13 */
+/* common.c 4.3 83/05/18 */
/*
* Routines and data common to all the line printer functions.
*/
/*
* Routines and data common to all the line printer functions.
*/
* Create a connection to the remote printer server.
* Most of this code comes from rcmd.c.
*/
* Create a connection to the remote printer server.
* Most of this code comes from rcmd.c.
*/
+getport(rhost)
+ char *rhost;
{
struct hostent *hp;
struct servent *sp;
{
struct hostent *hp;
struct servent *sp;
/*
* Get the host address and port number to connect to.
*/
/*
* Get the host address and port number to connect to.
*/
fatal("no remote host to connect to");
fatal("no remote host to connect to");
- hp = gethostbyname(RM);
+ hp = gethostbyname(rhost);
- fatal("unknown host %s", RM);
+ fatal("unknown host %s", rhost);
sp = getservbyname("printer", "tcp");
if (sp == NULL)
fatal("printer/tcp: unknown service");
sp = getservbyname("printer", "tcp");
if (sp == NULL)
fatal("printer/tcp: unknown service");
if (errno != EADDRINUSE && errno != EADDRNOTAVAIL)
return(-1);
(*alport)--;
if (errno != EADDRINUSE && errno != EADDRNOTAVAIL)
return(-1);
(*alport)--;
- if (*alport == IPPORT_RESERVED/2) {
- printf("%s: All ports in use\n", name);
+ if (*alport == IPPORT_RESERVED/2)
-/* rmjob.c 4.2 83/05/13 */
+/* rmjob.c 4.3 83/05/18 */
/*
* rmjob - remove the specified jobs from the queue.
*/
/*
* rmjob - remove the specified jobs from the queue.
*/
LP = DEFDEVLP;
if ((RP = pgetstr("rp", &bp)) == NULL)
RP = DEFLP;
LP = DEFDEVLP;
if ((RP = pgetstr("rp", &bp)) == NULL)
RP = DEFLP;
- if ((RM = pgetstr("rm", &bp)) == NULL)
- RM = host;
+ RM = pgetstr("rm", &bp);
/*
* If the format was `lprm -' and the user isn't the super-user,
/*
* If the format was `lprm -' and the user isn't the super-user,
}
cur_daemon = atoi(line);
for (i = 1; (n = fread(current, sizeof(char), sizeof(current), fp)) <= 0; i++) {
}
cur_daemon = atoi(line);
for (i = 1; (n = fread(current, sizeof(char), sizeof(current), fp)) <= 0; i++) {
(void) sprintf(cp, " %d", requ[i]);
}
strcat(cp, "\n");
(void) sprintf(cp, " %d", requ[i]);
}
strcat(cp, "\n");
if (rem < 0) {
if (from != host)
printf("%s: ", host);
if (rem < 0) {
if (from != host)
printf("%s: ", host);
-/* printjob.c 4.2 83/05/16 */
+/* printjob.c 4.3 83/05/18 */
/*
* printjob -- print jobs in the queue.
*
/*
* printjob -- print jobs in the queue.
*
status("%s is ready and printing", printer);
} else if (RM != NULL) {
for (i = 1; ; i = i < 512 ? i << 1 : i) {
status("%s is ready and printing", printer);
} else if (RM != NULL) {
for (i = 1; ; i = i < 512 ? i << 1 : i) {
if (pfd >= 0) {
(void) sprintf(line, "\2%s\n", RP);
n = strlen(line);
if (pfd >= 0) {
(void) sprintf(line, "\2%s\n", RP);
n = strlen(line);
char lpr_id[] = "~|^`lpr.c:\t4.2\t1 May 1981\n";
char lpr_id[] = "~|^`lpr.c:\t4.2\t1 May 1981\n";
-/* lpr.c 4.16 83/05/13 */
+/* lpr.c 4.17 83/05/18 */
/*
* lpr -- off line print
*
/*
* lpr -- off line print
*
MX = DEFMX;
if ((DU = pgetnum("du")) < 0)
DU = DEFUID;
MX = DEFMX;
if ((DU = pgetnum("du")) < 0)
DU = DEFUID;
- RM = host; /* machine for getport to connect to */