biometric-authentication/0001-add-getenv.patch
2023-05-23 09:59:13 +08:00

33 lines
1.2 KiB
Diff

From 8fe61f2bf34569b0a0995c7ae77f6fb237d01e4d Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Tue, 7 Mar 2023 15:17:03 +0800
Subject: [PATCH] add getenv
---
src/drivers/community-multidevice/community_ops.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/drivers/community-multidevice/community_ops.c b/src/drivers/community-multidevice/community_ops.c
index 9766959..9f5bd15 100644
--- a/src/drivers/community-multidevice/community_ops.c
+++ b/src/drivers/community-multidevice/community_ops.c
@@ -56,10 +56,11 @@ int community_ops_discover(bio_dev *dev)
bio_print_debug ("bio_drv_demo_ops_discover start\n");
int ret = 0;
-
- if ((strcmp(getenv("BIO_PRINT_LEVEL"), "7") == 0) && (strcmp(getenv("BIO_PRINT_COLOR"), "1") == 0))
- setenv ("G_MESSAGES_DEBUG", "all", 0);
-
+ if (getenv("BIO_PRINT_LEVEL") != NULL && getenv("BIO_PRINT_COLOR") != NULL)
+ {
+ if ((strcmp(getenv("BIO_PRINT_LEVEL"), "7") == 0) && (strcmp(getenv("BIO_PRINT_COLOR"), "1") == 0))
+ setenv ("G_MESSAGES_DEBUG", "all", 0);
+ }
// 探测设备
ret = device_discover (dev);
if ( ret < 0 ) {
--
2.39.1