summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-04-01 22:48:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-04-01 22:48:58 +0000
commitd12245b23d33f6a68f6a862049eb520b7249f63f (patch)
tree17998466ec1854288c36977909cc01f96cf25fe7 /libexec
parent174ab84d91b1aacd79bb7a46f098bcb5662e250b (diff)
minor lint cleaning; ok millert
Diffstat (limited to 'libexec')
-rw-r--r--libexec/mail.local/locking.c8
-rw-r--r--libexec/mail.local/mail.local.c16
-rw-r--r--libexec/mail.local/mail.local.h4
3 files changed, 15 insertions, 13 deletions
diff --git a/libexec/mail.local/locking.c b/libexec/mail.local/locking.c
index 4c29d7d0d47..a74aa49ba06 100644
--- a/libexec/mail.local/locking.c
+++ b/libexec/mail.local/locking.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: locking.c,v 1.7 2003/07/10 00:04:28 david Exp $ */
+/* $OpenBSD: locking.c,v 1.8 2006/04/01 22:48:57 deraadt Exp $ */
/*
* Copyright (c) 1996-1998 Theo de Raadt <deraadt@theos.com>
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: locking.c,v 1.7 2003/07/10 00:04:28 david Exp $";
+static char rcsid[] = "$OpenBSD: locking.c,v 1.8 2006/04/01 22:48:57 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -117,7 +117,7 @@ again:
}
}
}
- sleep(1 << tries);
+ sleep(1U << tries);
tries++;
continue;
}
@@ -134,7 +134,7 @@ again:
merr(NOTFATAL, "%s: %s", lpath, strerror(errno));
return(-1);
}
- sleep(1 << tries);
+ sleep(1U << tries);
tries++;
}
}
diff --git a/libexec/mail.local/mail.local.c b/libexec/mail.local/mail.local.c
index be9b91bd48e..471f72b4713 100644
--- a/libexec/mail.local/mail.local.c
+++ b/libexec/mail.local/mail.local.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mail.local.c,v 1.28 2006/01/02 16:22:46 millert Exp $ */
+/* $OpenBSD: mail.local.c,v 1.29 2006/04/01 22:48:57 deraadt Exp $ */
/*-
* Copyright (c) 1996-1998 Theo de Raadt <deraadt@theos.com>
@@ -41,7 +41,7 @@ char copyright[] =
#if 0
static char sccsid[] = "from: @(#)mail.local.c 5.6 (Berkeley) 6/19/91";
#else
-static char rcsid[] = "$OpenBSD: mail.local.c,v 1.28 2006/01/02 16:22:46 millert Exp $";
+static char rcsid[] = "$OpenBSD: mail.local.c,v 1.29 2006/04/01 22:48:57 deraadt Exp $";
#endif
#endif /* not lint */
@@ -120,14 +120,14 @@ main(int argc, char *argv[])
!(pw = getpwnam(from)) || pw->pw_uid != uid))
from = (pw = getpwuid(uid)) ? pw->pw_name : "???";
- fd = store(from);
+ fd = storemail(from);
for (eval = 0; *argv; ++argv)
eval |= deliver(fd, *argv, lockfile);
exit(eval);
}
int
-store(char *from)
+storemail(char *from)
{
FILE *fp = NULL;
time_t tval;
@@ -185,9 +185,11 @@ deliver(int fd, char *name, int lockfile)
{
struct stat sb, fsb;
struct passwd *pw;
- int mbfd=-1, nr, nw, off, rval=1, lfd=-1;
+ int mbfd=-1, rval=1, lfd=-1;
char biffmsg[100], buf[8*1024], path[MAXPATHLEN];
off_t curoff;
+ size_t off;
+ ssize_t nr, nw;
/*
* Disallow delivery to unknown names -- special mailboxes can be
@@ -305,7 +307,7 @@ notifybiff(char *msg)
static int f = -1;
struct hostent *hp;
struct servent *sp;
- int len;
+ size_t len;
if (!addr.sin_family) {
/* Be silent if biff service not available. */
@@ -318,7 +320,7 @@ notifybiff(char *msg)
addr.sin_len = sizeof(struct sockaddr_in);
addr.sin_family = hp->h_addrtype;
addr.sin_port = sp->s_port;
- bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);
+ bcopy(hp->h_addr, &addr.sin_addr, (size_t)hp->h_length);
}
if (f < 0 && (f = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
merr(NOTFATAL, "socket: %s", strerror(errno));
diff --git a/libexec/mail.local/mail.local.h b/libexec/mail.local/mail.local.h
index f259c6c9222..0377aa20364 100644
--- a/libexec/mail.local/mail.local.h
+++ b/libexec/mail.local/mail.local.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mail.local.h,v 1.4 2003/06/02 19:38:24 millert Exp $ */
+/* $OpenBSD: mail.local.h,v 1.5 2006/04/01 22:48:57 deraadt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,5 +38,5 @@ void merr(int, const char *, ...);
int getlock(char *, struct passwd *);
void notifybiff(char *);
void rellock(void);
-int store(char *);
+int storemail(char *);
void usage(void);