summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 15:57:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 15:57:07 +0000
commit60fe8d206af3d3b0f3ba128b65a98f2cd14041d9 (patch)
tree571db6f8945b60f7d846ff87f8802920bcb9a709 /usr.sbin
parent34bed40f0e4ffac75a5a56d6df45e6d50c363934 (diff)
move to <limits.h> where possible, annotate <sys/param.h> otherwise
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/iscsid/initiator.c6
-rw-r--r--usr.sbin/iscsid/iscsid.c5
-rw-r--r--usr.sbin/iscsid/util.c6
-rw-r--r--usr.sbin/iscsid/vscsi.c3
4 files changed, 9 insertions, 11 deletions
diff --git a/usr.sbin/iscsid/initiator.c b/usr.sbin/iscsid/initiator.c
index 22ab3d856d5..e8e0a215d33 100644
--- a/usr.sbin/iscsid/initiator.c
+++ b/usr.sbin/iscsid/initiator.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: initiator.c,v 1.14 2014/11/23 13:08:21 claudio Exp $ */
+/* $OpenBSD: initiator.c,v 1.15 2015/01/16 15:57:06 deraadt Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
@@ -29,6 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "iscsid.h"
#include "log.h"
@@ -542,7 +542,7 @@ initiator_logout_cb(struct connection *c, void *arg, struct pdu *p)
char *
default_initiator_name(void)
{
- char *s, hostname[MAXHOSTNAMELEN];
+ char *s, hostname[HOST_NAME_MAX+1];
if (gethostname(hostname, sizeof(hostname)))
strlcpy(hostname, "initiator", sizeof(hostname));
diff --git a/usr.sbin/iscsid/iscsid.c b/usr.sbin/iscsid/iscsid.c
index a204db9391c..4a02c2aa387 100644
--- a/usr.sbin/iscsid/iscsid.c
+++ b/usr.sbin/iscsid/iscsid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iscsid.c,v 1.17 2014/11/03 16:45:00 tedu Exp $ */
+/* $OpenBSD: iscsid.c,v 1.18 2015/01/16 15:57:06 deraadt Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -16,8 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/param.h> /* nitems */
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
diff --git a/usr.sbin/iscsid/util.c b/usr.sbin/iscsid/util.c
index ccebaab1eb8..bf510d2d6e0 100644
--- a/usr.sbin/iscsid/util.c
+++ b/usr.sbin/iscsid/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.4 2014/04/21 17:41:52 claudio Exp $ */
+/* $OpenBSD: util.c,v 1.5 2015/01/16 15:57:06 deraadt Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -15,8 +15,8 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <sys/param.h>
+
+#include <sys/param.h> /* nitems */
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/uio.h>
diff --git a/usr.sbin/iscsid/vscsi.c b/usr.sbin/iscsid/vscsi.c
index f42985869a5..4093d7ed1fa 100644
--- a/usr.sbin/iscsid/vscsi.c
+++ b/usr.sbin/iscsid/vscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vscsi.c,v 1.14 2014/05/10 11:28:02 claudio Exp $ */
+/* $OpenBSD: vscsi.c,v 1.15 2015/01/16 15:57:06 deraadt Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
#include <sys/param.h> /* for nitems */
#include <sys/ioctl.h>
#include <sys/queue.h>