[kde-freebsd] kde 4.3.4: preview thumbnails for pdf files

Andriy Gapon avg at icyb.net.ua
Tue Feb 9 08:35:42 CET 2010


on 09/02/2010 09:24 Andriy Gapon said the following:
> The strange data seems to be a message "Cannot create thumbnail..." in unicode.
> And the problem seems to be that thumbnail/preview code doesn't expect waitpid
> to return with EINTR caused by SIGCHLD when a child (ghostscript process)
> terminates.
> 
> This is a snippet from kdegraphics-4.3.4/thumbnailers/ps/gscreator.cpp:
> if (waitpid(pid, &status, 0) != pid || (status != 0  && status != 256) )
>   ok = false;
> 
> I believe that EINTR might be generated here, because some wrapping KDE-generic
> code installs a SIGCHLD handler.  But I am not sure about that.
> I am also not sure if FreeBSD behaves correctly here in either case.
> 

Looks like I can work around the problem by changing the above snippet to the
following:
int ret;
do {
  ret = waitpid(pid, &status, 0);
} while (ret == -1 && errno == EINTR);
if (ret != pid || (status != 0  && status != 256) )
  ok = false;

But, as I've said, I am not what is to blame here - gscreator.cpp code or OS
code.  Perhaps, the proper solution would be to simply reset a signal handler
for SIGCHLD.  But I know too little KDE to choose a right solution, just sharing
my observations and ideas.

P.S.
Some mis-addressed whining :)
Generating a picture of the first page of a document is great, but not always it
contains useful information or you can recognize a document by it.
I really like KDE3 way of providing some additional PDF meta-information like
document title and author.
For some reason KDE4 shed that feature. Sigh.

-- 
Andriy Gapon


More information about the kde-freebsd mailing list