HGSaneUser修改sane驱动查找目录
This commit is contained in:
parent
75f47b8f1a
commit
21f91712ac
|
@ -13,6 +13,29 @@ HGSaneManagerImpl::~HGSaneManagerImpl()
|
||||||
|
|
||||||
HGResult HGSaneManagerImpl::Create()
|
HGResult HGSaneManagerImpl::Create()
|
||||||
{
|
{
|
||||||
|
std::string archName;
|
||||||
|
FILE *file = popen("arch", "r");
|
||||||
|
if (NULL != file)
|
||||||
|
{
|
||||||
|
char str[256] = {0};
|
||||||
|
if (NULL != fgets(str, 256, file))
|
||||||
|
{
|
||||||
|
char *p = str;
|
||||||
|
while (0 != *p && '\n' != *p)
|
||||||
|
{
|
||||||
|
archName.push_back(*p);
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (archName.empty())
|
||||||
|
{
|
||||||
|
return HGBASE_ERR_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
char manuPath[] = "/etc/sane.d/dll.d";
|
char manuPath[] = "/etc/sane.d/dll.d";
|
||||||
|
|
||||||
DIR* dir = opendir(manuPath);
|
DIR* dir = opendir(manuPath);
|
||||||
|
@ -70,7 +93,7 @@ HGResult HGSaneManagerImpl::Create()
|
||||||
pr.first = manuName;
|
pr.first = manuName;
|
||||||
|
|
||||||
char sanePath[256];
|
char sanePath[256];
|
||||||
sprintf(sanePath, "/usr/lib/x86_64-linux-gnu/sane/libsane-%s.so.1", manuName.c_str());
|
sprintf(sanePath, "/usr/lib/%s-linux-gnu/sane/libsane-%s.so.1", archName.c_str(), manuName.c_str());
|
||||||
pr.second = sanePath;
|
pr.second = sanePath;
|
||||||
|
|
||||||
m_vSource.push_back(pr);
|
m_vSource.push_back(pr);
|
||||||
|
|
Loading…
Reference in New Issue