fix: handle EINTR correctly in get_cpu_mask_from_sysfs
[urcu.git] / tests / regression / test_urcu_fork.c
index f61420168b9005c92226760bf2a7c98356de5f77..52ccce756b293ab401c4abb6644b4294c51fe8e5 100644 (file)
@@ -1,27 +1,11 @@
+// SPDX-FileCopyrightText: 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+//
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 /*
- * test_urcu_fork.c
- *
  * Userspace RCU library - test program (fork)
- *
- * Copyright February 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
-#include "config.h"
 #include <stdio.h>
 #include <pthread.h>
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <assert.h>
 #include <sched.h>
 #include <errno.h>
 
+#include <urcu/assert.h>
 #include <urcu/arch.h>
 #include <urcu/tls-compat.h>
 
@@ -90,8 +74,8 @@ static void test_rcu(void)
        rcu_read_lock();
        rcu_read_unlock();
 
-       node = malloc(sizeof(*node));
-       assert(node);
+       node = (struct test_node *) malloc(sizeof(*node));
+       urcu_posix_assert(node);
 
        call_rcu(&node->head, cb);
 
@@ -165,7 +149,7 @@ static int do_fork(const char *execname)
        }
 }
 
-int main(int argc, char **argv)
+int main(int argc __attribute__((unused)), char **argv)
 {
        unsigned int i;
 
This page took 0.023024 seconds and 4 git commands to generate.