+/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $ */
+
/*
* Copyright (c) 2008, Damien Miller <djm@openbsd.org>
*
* number inside the range we need, so it should rarely need
* to re-roll.
*/
- do
+ for (;;) {
r = arc4random();
- while (r < min);
+ if (r >= min)
+ break;
+ }
return r % upper_bound;
}
-/* $NetBSD: pidfile.c,v 1.14 2016/04/12 20:40:43 roy Exp $ */
+/* $NetBSD: pidfile.c,v 1.16 2021/08/01 15:29:29 andvar Exp $ */
/*-
* Copyright (c) 1999, 2016 The NetBSD Foundation, Inc.
}
/* Returns the process ID inside path on success, otherwise -1.
- * If no path is given, use the last pidfile path, othewise the default one. */
+ * If no path is given, use the last pidfile path, otherwise the default one. */
pid_t
pidfile_read(const char *path)
{
if (errno == EAGAIN) {
/* The pidfile is locked, return the process ID
* it contains.
- * If sucessful, set errno to EEXIST. */
+ * If successful, set errno to EEXIST. */
if ((pid = pidfile_read(path)) != -1)
errno = EEXIST;
} else
-/* $NetBSD: rb.c,v 1.14 2019/03/08 09:14:54 roy Exp $ */
+/* $NetBSD: rb.c,v 1.16 2021/09/16 21:29:41 andvar Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
#include "config.h"
#include "common.h"
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <sys/types.h>
#include <stddef.h>
#define KASSERT(s) do { } while (/*CONSTCOND*/ 0)
#define __rbt_unused __unused
#endif
-__RCSID("$NetBSD: rb.c,v 1.14 2019/03/08 09:14:54 roy Exp $");
+__RCSID("$NetBSD: rb.c,v 1.16 2021/09/16 21:29:41 andvar Exp $");
#else
#include <lib/libkern/libkern.h>
-__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.14 2019/03/08 09:14:54 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.16 2021/09/16 21:29:41 andvar Exp $");
#ifndef DIAGNOSTIC
#define __rbt_unused __unused
#else
KASSERT(rb_tree_check_node(rbt, self, NULL, true));
}
- /* Succesfully inserted, return our node pointer. */
+ /* Successfully inserted, return our node pointer. */
return object;
}
-/* $OpenBSD: strlcpy.c,v 1.15 2016/10/16 17:37:39 dtucker Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */
/*
- * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998, 2015 Todd C. Miller <millert@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above