mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
arch: up_assert shouldn't call exit directly
since exit will be only callable from userspace and change the 1st argument from "const uint8_t *" to "const char *" Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I86487d57210ab63109148232da71dbc4d60a563b
This commit is contained in:
committed by
Abdelatif Guettouche
parent
774ea6eae7
commit
d6827cab60
@@ -21,6 +21,7 @@
|
||||
include $(TOPDIR)/Make.defs
|
||||
|
||||
include aio/Make.defs
|
||||
include assert/Make.defs
|
||||
include audio/Make.defs
|
||||
include builtin/Make.defs
|
||||
include dirent/Make.defs
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
############################################################################
|
||||
# libs/libc/assert/Make.defs
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
CSRCS += lib_assert.c
|
||||
|
||||
# Add the assert directory to the build
|
||||
|
||||
DEPPATH += --dep-path assert
|
||||
VPATH += :assert
|
||||
@@ -0,0 +1,38 @@
|
||||
/****************************************************************************
|
||||
* libs/libc/assert/lib_assert.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void _assert(FAR const char *filename, int linenum)
|
||||
{
|
||||
up_assert(filename, linenum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Reference in New Issue
Block a user