aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source/rmjob.c
diff options
context:
space:
mode:
authorGarance A Drosehn <gad@FreeBSD.org>2001-06-12 16:38:20 +0000
committerGarance A Drosehn <gad@FreeBSD.org>2001-06-12 16:38:20 +0000
commitba7a1ad76a812b38f8bddc730e03a14591d997b8 (patch)
tree115b09aed7f19dda18dbe2e66eba92a08b0d2441 /usr.sbin/lpr/common_source/rmjob.c
parent0d1b691ed7d4817c696a6915da266ecc4f1b48ae (diff)
downloadsrc-ba7a1ad76a812b38f8bddc730e03a14591d997b8.tar.gz
src-ba7a1ad76a812b38f8bddc730e03a14591d997b8.zip
Fix about 90-100 warnings one gets when trying to compile lpr&friends
with BDECFLAGS on, mainly by adding 'const' to parameters in a number of routine declarations. While I'm at it, ANSI-fy all of the routine declarations. The resulting object code is exactly the same after this update as before it, with the exception of one unavoidable change to lpd.o on freebsd/alpha. Also added $FreeBSD$ line to lpc/extern.h lpc/lpc.h lptest/lptest.c Reviewed by: /sbin/md5, and no feedback from freebsd-audit
Notes
Notes: svn path=/head/; revision=78146
Diffstat (limited to 'usr.sbin/lpr/common_source/rmjob.c')
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index f7419e02f676..39a7d0f132be 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -73,12 +73,11 @@ static char current[7+MAXHOSTNAMELEN]; /* active control file name */
extern uid_t uid, euid; /* real and effective user id's */
-static void alarmhandler __P((int));
-static void do_unlink __P((char *));
+static void alarmhandler(int _signo);
+static void do_unlink(char *_file);
void
-rmjob(printer)
- const char *printer;
+rmjob(const char *printer)
{
register int i, nitems;
int assasinated = 0;
@@ -154,17 +153,15 @@ rmjob(printer)
* Return boolean indicating existence of a lock file.
*/
int
-lockchk(pp, s)
- struct printer *pp;
- char *s;
+lockchk(struct printer *pp, char *slockf)
{
register FILE *fp;
register int i, n;
seteuid(euid);
- if ((fp = fopen(s, "r")) == NULL) {
+ if ((fp = fopen(slockf, "r")) == NULL) {
if (errno == EACCES)
- fatal(pp, "%s: %s", s, strerror(errno));
+ fatal(pp, "%s: %s", slockf, strerror(errno));
else
return(0);
}
@@ -194,9 +191,7 @@ lockchk(pp, s)
* Process a control file.
*/
void
-process(pp, file)
- const struct printer *pp;
- char *file;
+process(const struct printer *pp, char *file)
{
FILE *cfp;
@@ -219,8 +214,7 @@ process(pp, file)
}
static void
-do_unlink(file)
- char *file;
+do_unlink(char *file)
{
int ret;
@@ -236,8 +230,7 @@ do_unlink(file)
* Do the dirty work in checking
*/
int
-chk(file)
- char *file;
+chk(char *file)
{
register int *r, n;
register char **u, *cp;
@@ -293,13 +286,12 @@ chk(file)
* Normal users can only remove the file from where it was sent.
*/
int
-isowner(owner, file)
- char *owner, *file;
+isowner(char *owner, char *file)
{
if (!strcmp(person, root) && (from == host || !strcmp(from, file+6)))
- return(1);
+ return (1);
if (!strcmp(person, owner) && !strcmp(from, file+6))
- return(1);
+ return (1);
if (from != host)
printf("%s: ", host);
printf("%s: Permission denied\n", file);
@@ -311,8 +303,7 @@ isowner(owner, file)
* then try removing files on the remote machine.
*/
void
-rmremote(pp)
- const struct printer *pp;
+rmremote(const struct printer *pp)
{
int i, elem, firstreq, niov, rem, totlen;
char buf[BUFSIZ];
@@ -390,15 +381,14 @@ rmremote(pp)
* Return 1 if the filename begins with 'cf'
*/
int
-iscf(d)
- struct dirent *d;
+iscf(struct dirent *d)
{
return(d->d_name[0] == 'c' && d->d_name[1] == 'f');
}
void
-alarmhandler(signo)
- int signo;
+alarmhandler(int signo __unused)
{
- /* ignored */
+ /* the signal is ignored */
+ /* (the '__unused' is just to avoid a compile-time warning) */
}