From b31815f89dd4c7c33796bce838c1ae720d979558 Mon Sep 17 00:00:00 2001 From: baozewei Date: Wed, 15 Jan 2025 18:22:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsane=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88crash=E9=97=AE=E9=A2=98=20Signed-off-by:baozewei@huawe?= =?UTF-8?q?i.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: baozewei --- patches/modifying_driver_search_path.patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/patches/modifying_driver_search_path.patch b/patches/modifying_driver_search_path.patch index e4909507e..32497a955 100644 --- a/patches/modifying_driver_search_path.patch +++ b/patches/modifying_driver_search_path.patch @@ -1,5 +1,5 @@ diff --git a/backend/dll.c b/backend/dll.c -index bf34c4f6d..7cb7fd508 100644 +index bf34c4f6d..9b13d3a59 100644 --- a/backend/dll.c +++ b/backend/dll.c @@ -292,6 +292,46 @@ static const char *op_name[] = { @@ -58,7 +58,7 @@ index bf34c4f6d..7cb7fd508 100644 #else snprintf (libname, sizeof (libname), "%s/" PREFIX "%s" POSTFIX, dir, be->name, V_MAJOR); -@@ -807,6 +849,26 @@ read_config (const char *conffile) +@@ -807,6 +849,30 @@ read_config (const char *conffile) fclose (fp); } @@ -69,6 +69,10 @@ index bf34c4f6d..7cb7fd508 100644 + const char* dir = "/data/service/el1/public/print_service/sane/config"; + DBG(1, "%s: config_dir : %s ", __func__, dir); + DIR *config_dir = opendir(dir); ++ if (config_dir == NULL) { ++ DBG(1, "sane_init/read_configs: opendir failed: %s\n", strerror (errno)); ++ return; ++ } + struct dirent *entry; + while ((entry = readdir(config_dir)) != NULL) { + // ignore '.' and '..' @@ -85,7 +89,7 @@ index bf34c4f6d..7cb7fd508 100644 static void read_dlld (void) { -@@ -931,8 +993,11 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) +@@ -931,8 +997,11 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * Read dll.d first, so that the extras backends will be tried last */ read_dlld (); @@ -111,4 +115,4 @@ index 20dfa104b..206a4147e 100644 + /* Define to 1 if you have libusb-0.1 */ /* #undef HAVE_LIBUSB_LEGACY */ - \ No newline at end of file + -- Gitee