From dbef2d49411aa3e49a7df88bc2c30f396b64502b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 25 Oct 2016 19:04:44 +0000 Subject: [PATCH] Fix two backwards tests. CID: 1365227, 1365228 --- Makefile.ficl | 43 --------------------------------------- sys/boot/efi/libefi/env.c | 8 ++++---- 2 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 Makefile.ficl diff --git a/Makefile.ficl b/Makefile.ficl deleted file mode 100644 index de1427aa428..00000000000 --- a/Makefile.ficl +++ /dev/null @@ -1,43 +0,0 @@ -# $FreeBSD$ - -# Common flags to build FICL related files - -FICLDIR?= ${SRCTOP}/sys/boot/ficl - -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) -FICL_CPUARCH= i386 -.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" -FICL_CPUARCH= mips64 -.else -FICL_CPUARCH= ${MACHINE_CPUARCH} -.endif - -.PATH: ${FICLDIR} ${FICLDIR}/${FICL_CPUARCH} - -.if ${MACHINE_CPUARCH} == "amd64" -.if defined(FICL32) -CFLAGS+= -m32 -I. -.else -CFLAGS+= -fPIC -.endif -.endif - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -I. -.endif - -CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common - -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) -.if !exists(machine) -${SRCS:M*.c:R:S/$/.o/g}: machine - -beforedepend ${OBJS}: machine -.endif - -machine: .NOMETA - ln -sf ${.CURDIR}/../../i386/include machine - -CLEANFILES+= machine -.endif diff --git a/sys/boot/efi/libefi/env.c b/sys/boot/efi/libefi/env.c index a26eb725fd0..66b947d9b06 100644 --- a/sys/boot/efi/libefi/env.c +++ b/sys/boot/efi/libefi/env.c @@ -114,7 +114,7 @@ ficlEfiSetenv(FICL_VM *pVM) #ifndef TESTMAIN guid = (char*)ficlMalloc(guids); - if (guid != NULL) + if (guid == NULL) vmThrowErr(pVM, "Error: out of memory"); memcpy(guid, guidp, guids); uuid_from_string(guid, &u, &ustatus); @@ -131,7 +131,7 @@ ficlEfiSetenv(FICL_VM *pVM) name[names] = (CHAR16)0; value = (char*)ficlMalloc(values + 1); - if (value != NULL) + if (value == NULL) vmThrowErr(pVM, "Error: out of memory"); memcpy(value, valuep, values); @@ -166,7 +166,7 @@ ficlEfiGetenv(FICL_VM *pVM) #ifndef TESTMAIN name = (char*) ficlMalloc(names+1); - if (!name) + if (name == NULL) vmThrowErr(pVM, "Error: out of memory"); strncpy(name, namep, names); name[names] = '\0'; @@ -201,7 +201,7 @@ ficlEfiUnsetenv(FICL_VM *pVM) #ifndef TESTMAIN name = (char*) ficlMalloc(names+1); - if (!name) + if (name == NULL) vmThrowErr(pVM, "Error: out of memory"); strncpy(name, namep, names); name[names] = '\0';