]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
compat sync (#226)
authorTobias Heider <tobhe@users.noreply.github.com>
Wed, 19 Jul 2023 12:29:48 +0000 (14:29 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2023 12:29:48 +0000 (13:29 +0100)
* compat: sync pidfile.c with netbsd v1.16

- fix typos in word "otherwise".
- s/sucess/success/ in comment.

* compat: sync rb.c with netbsd v1.16

- fix typos in word "successfully", mainly s/succesfully/successfully/.
- toolify

* compat: sync strlcpy.c with openbsd v1.16

- I am retiring my old email address;  replace it with my OpenBSD one.

* compat: sync arc4random_uniform.c with openbsd v1.3

compat/arc4random_uniform.c
compat/pidfile.c
compat/rb.c
compat/strlcpy.c

index 0f1b7b29675941199987d84cd0c8b2d7fd639c7c..4511722909b3c3b566701f29b91a61c653fb37cc 100644 (file)
@@ -1,3 +1,5 @@
+/*     $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $    */
+
 /*
  * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
  *
@@ -48,9 +50,11 @@ arc4random_uniform(uint32_t upper_bound)
         * 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;
 }
index 9dfd9c468a7aefd33ccb448a69867c3eb2622450..8d2e5a838c0ea7576cb4f745d8c1204e24643f4c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $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.
@@ -131,7 +131,7 @@ pidfile_varrun_path(char *path, size_t len, const char *bname)
 }
 
 /* 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)
 {
@@ -239,7 +239,7 @@ return_pid:
                        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
index 3c0bed5f70d5ce7ef47d22d1dca7efa76227ce23..4dfbd0d29212d549818c481104eccd78a9083ea4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $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
@@ -312,7 +316,7 @@ rb_tree_insert_node(struct rb_tree *rbt, void *object)
                KASSERT(rb_tree_check_node(rbt, self, NULL, true));
        }
 
-       /* Succesfully inserted, return our node pointer. */
+       /* Successfully inserted, return our node pointer. */
        return object;
 }
 
index 1fb4a2f9615d54f06fc7ecbf7e9d4a5e1bcc3f34..eceb4b4c05df787a055ae6d3c414904719dc4334 100644 (file)
@@ -1,7 +1,7 @@
-/*     $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