|
|
| version 1.2, 2003/06/17 04:29:56 | version 1.3, 2004/03/22 22:32:51 |
|---|---|
| Line 39 | Line 39 |
| * @(#) Copyright (c) 1983, 1989, 1993 The Regents of the University of California. All rights reserved. | * @(#) Copyright (c) 1983, 1989, 1993 The Regents of the University of California. All rights reserved. |
| * @(#)from: lpr.c 8.4 (Berkeley) 4/28/95 | * @(#)from: lpr.c 8.4 (Berkeley) 4/28/95 |
| * $FreeBSD: src/usr.sbin/lpr/lpr/lpr.c,v 1.32.2.11 2002/04/28 23:40:23 gad Exp $ | * $FreeBSD: src/usr.sbin/lpr/lpr/lpr.c,v 1.32.2.11 2002/04/28 23:40:23 gad Exp $ |
| * $DragonFly: src/usr.sbin/lpr/lpr/lpr.c,v 1.1 2003/06/16 07:25:32 dillon Exp $ | * $DragonFly$ |
| */ | */ |
| /* | /* |
| Line 525 main(int argc, char *argv[]) | Line 525 main(int argc, char *argv[]) |
| static void | static void |
| copy(const struct printer *pp, int f, const char n[]) | copy(const struct printer *pp, int f, const char n[]) |
| { | { |
| register int fd, i, nr, nc; | int fd, i, nr, nc; |
| char buf[BUFSIZ]; | char buf[BUFSIZ]; |
| if (format == 'p') | if (format == 'p') |
| Line 567 copy(const struct printer *pp, int f, co | Line 567 copy(const struct printer *pp, int f, co |
| static const char * | static const char * |
| linked(const char *file) | linked(const char *file) |
| { | { |
| register char *cp; | char *cp; |
| static char buf[MAXPATHLEN]; | static char buf[MAXPATHLEN]; |
| register int ret; | int ret; |
| if (*file != '/') { | if (*file != '/') { |
| if (getcwd(buf, sizeof(buf)) == NULL) | if (getcwd(buf, sizeof(buf)) == NULL) |
| Line 606 static void | Line 606 static void |
| card(int c, const char *p2) | card(int c, const char *p2) |
| { | { |
| char buf[BUFSIZ]; | char buf[BUFSIZ]; |
| register char *p1 = buf; | char *p1 = buf; |
| size_t len = 2; | size_t len = 2; |
| *p1++ = c; | *p1++ = c; |
| Line 624 card(int c, const char *p2) | Line 624 card(int c, const char *p2) |
| static int | static int |
| nfile(char *n) | nfile(char *n) |
| { | { |
| register int f; | int f; |
| int oldumask = umask(0); /* should block signals */ | int oldumask = umask(0); /* should block signals */ |
| seteuid(euid); | seteuid(euid); |
| Line 656 nfile(char *n) | Line 656 nfile(char *n) |
| static void | static void |
| cleanup(int signo __unused) | cleanup(int signo __unused) |
| { | { |
| register int i; | int i; |
| signal(SIGHUP, SIG_IGN); | signal(SIGHUP, SIG_IGN); |
| signal(SIGINT, SIG_IGN); | signal(SIGINT, SIG_IGN); |
| Line 780 static char * | Line 780 static char * |
| itoa(int i) | itoa(int i) |
| { | { |
| static char b[10] = "########"; | static char b[10] = "########"; |
| register char *p; | char *p; |
| p = &b[8]; | p = &b[8]; |
| do | do |
| Line 830 usage(void) | Line 830 usage(void) |
| static void | static void |
| mktemps(const struct printer *pp) | mktemps(const struct printer *pp) |
| { | { |
| register int len, fd, n; | int len, fd, n; |
| register char *cp; | char *cp; |
| char buf[BUFSIZ]; | char buf[BUFSIZ]; |
| (void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir); | (void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir); |
| Line 871 mktemps(const struct printer *pp) | Line 871 mktemps(const struct printer *pp) |
| static char * | static char * |
| lmktemp(const struct printer *pp, const char *id, int num, int len) | lmktemp(const struct printer *pp, const char *id, int num, int len) |
| { | { |
| register char *s; | char *s; |
| if ((s = malloc(len)) == NULL) | if ((s = malloc(len)) == NULL) |
| errx(1, "out of memory"); | errx(1, "out of memory"); |