[sane-devel] PIXMA TS8300 Series not working

Till Kamppeter till.kamppeter at gmail.com
Wed Oct 7 21:29:14 BST 2020


Alex, you could suppress the stderr output of libxml.

Enclose the call of the libxml function(s) with the following code:

----------
   int fd1, fd2;

   /* Eliminate any output to stderr, to get rid of the error
      message output of the functions of libxml */
   fd1 = dup(2);
   fd2 = open("/dev/null", O_WRONLY);
   dup2(fd2, 2);
   close(fd2);

   /* Put any code using functions of libxml here: */
   ...

   /* Re-activate stderr output */
   dup2(fd1, 2);
   close(fd1);
----------

This redirects the stderr into /dev/null. After you are done with the 
libxml funxtions you can return to normal behavior, if you actually need 
to output something to stderr later.

Alternatively, you could use the receiving end of a pipe instead of fd2 
in the "dup2(fd2, 2)" if you want to capture libxml's stderr output (you 
would need to fork() before to create a process for receiving the stderr 
output, which reads the other end of the pipe).

    Till


On 07/10/2020 21:55, Alexander Pevzner wrote:
> On 10/7/20 10:39 PM, Yoann Le Montagner wrote:
>> Please find the log for 'SANE_DEBUG_AIRSCAN=1 scanimage -L' in 
>> attachment.
> 
> Now I see. sane-airscan discovers some IPP device "bbox Ippos Printer" 
> with the address 192.168.1.254 and attempts to check it for WSD support. 
> It does it by sending some HTTP request to that address. This request is 
> redirected to https://mabbox.bytel.fr:443/login.html and response from 
> there is not valid XML, so XML parser complains.
> 
> Unfortunately, libxml complains directly to stderr, and it cannot be 
> silenced.
> 
> So this problem is cosmetical, though annoying.
> 
>> Thanks for your work.
>>
>> Le 07/10/2020 à 21:35, Alexander Pevzner a écrit :
>>> On 10/7/20 10:29 PM, Yoann Le Montagner wrote:
>>>> The parser error is always there.
>>>
>>> Please, rerun scanimage with the following options:
>>>
>>> SANE_DEBUG_AIRSCAN=1 scanimage -L
>>>
>>>> Le 07/10/2020 à 21:27, Alexander Pevzner a écrit :
>>>>> Hi Yoann,
>>>>>
>>>>> On 10/7/20 6:38 PM, Yoann Le Montagner wrote:
>>>>>> 1) Start the PC
>>>>>> 2) scanimage -L -> OK, both drivers are here:
>>>>>>
>>>>>> yoann at yoann-desktop:~$ scanimage -L
>>>>>> Entity: line 1: parser error : Start tag expected, '<' not found
>>>>>>>>>>>> ^
>>>>> Do you see this "parser error" message every time you call 
>>>>> "scamimage -L", or it is hard to reproduce?
>>>>>
>>>>> If you can reproduce this message, I want to better investigate it.
>>>>>
>>>
>>>
> 
> 



More information about the sane-devel mailing list