Summary: | PS/PDF thumbnails don't work, EINTR from select() when running gs | ||
---|---|---|---|
Product: | [Unmaintained] kio | Reporter: | Jonathan Marten <jjm> |
Component: | kioslave | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | giovanni |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Other | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Patch as above, but unmangled |
Description
Jonathan Marten
2002-06-19 10:17:49 UTC
Created attachment 1774 [details]
Patch as above, but unmangled
The problem still exists in KDE 3.1.2, and the same patch fixes it.
Patch file is attached, hopefully intact this time.
Subject: kdebase/kioslave/thumbnail CVS commit by mueller: ignore EINTR in select(). Thanks for the patch. CCMAIL: 44098-done@bugs.kde.org M +6 -3 gscreator.cpp 1.17 --- kdebase/kioslave/thumbnail/gscreator.cpp #1.16:1.17 @@ -64,4 +64,5 @@ #include <sys/wait.h> #include <fcntl.h> +#include <errno.h> #include <qfile.h> @@ -233,6 +234,8 @@ bool GSCreator::create(const QString &pa tv.tv_sec = 20; tv.tv_usec = 0; - if (select(output[0] + 1, &fds, 0, 0, &tv) <= 0) + if (select(output[0] + 1, &fds, 0, 0, &tv) <= 0) { + if ( errno == EINTR || errno == EAGAIN ) continue; break; // error or timeout + } if (FD_ISSET(output[0], &fds)) { count = read(output[0], data.data() + offset, 1024); @@ -255,5 +258,5 @@ bool GSCreator::create(const QString &pa if (!ok) // error or timeout, gs probably didn't exit yet kill(pid, SIGTERM); - int status; + int status = 0; if (waitpid(pid, &status, 0) != pid || (status != 0 && status != 256) ) ok = false; |