diff options
Diffstat (limited to 'x11/kdelibs4/files/patch-kdeprint_cups_cupsdconf2')
-rw-r--r-- | x11/kdelibs4/files/patch-kdeprint_cups_cupsdconf2 | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/x11/kdelibs4/files/patch-kdeprint_cups_cupsdconf2 b/x11/kdelibs4/files/patch-kdeprint_cups_cupsdconf2 deleted file mode 100644 index b38391e67123..000000000000 --- a/x11/kdelibs4/files/patch-kdeprint_cups_cupsdconf2 +++ /dev/null @@ -1,65 +0,0 @@ ---- kdeprint/cups/cupsdconf2/cupsddialog.cpp Tue Sep 11 09:26:39 2007 -+++ kdeprint/cups/cupsdconf2/cupsddialog.cpp Tue Sep 11 14:38:28 2007 -@@ -44,6 +44,7 @@ - #include <kio/passdlg.h> - #include <kguiitem.h> - #include <kprocess.h> -+#include <qprocess.h> - - #include <signal.h> - #include <cups/cups.h> -@@ -69,24 +70,38 @@ - - int getServerPid() - { -- QDir dir("/proc",QString::null,QDir::Name,QDir::Dirs); -- for (uint i=0;i<dir.count();i++) -- { -- if (dir[i] == "." || dir[i] == ".." || dir[i] == "self") continue; -- QFile f("/proc/" + dir[i] + "/cmdline"); -- if (f.exists() && f.open(IO_ReadOnly)) -+ // /proc doesn't work the same in FreeBSD. The simplest way to get cupsd's pid is via pgrep. -+ #if defined(__FreeBSD__) -+ QProcess *proc = new QProcess(); -+ proc->addArgument("pgrep"); -+ proc->addArgument("cupsd"); -+ proc->start(); -+ while (proc->isRunning()); //Wait for process to exit -+ QString pidString = proc->readLineStdout(); -+ bool ok; -+ int pid = pidString.toInt(&ok); -+ if (ok) return pid; -+ return (-1); -+ #else -+ QDir dir("/proc",QString::null,QDir::Name,QDir::Dirs); -+ for (uint i=0;i<dir.count();i++) - { -- QTextStream t(&f); -- QString line; -- t >> line; -- f.close(); -- if (line.right(5) == "cupsd" || -- line.right(6).left(5) == "cupsd") // second condition for 2.4.x kernels -- // which add a null byte at the end -- return dir[i].toInt(); -+ if (dir[i] == "." || dir[i] == ".." || dir[i] == "self") continue; -+ QFile f("/proc/" + dir[i] + "/cmdline"); -+ if (f.exists() && f.open(IO_ReadOnly)) -+ { -+ QTextStream t(&f); -+ QString line; -+ t >> line; -+ f.close(); -+ if (line.right(5) == "cupsd" || -+ line.right(6).left(5) == "cupsd") // second condition for 2.4.x kernels -+ // which add a null byte at the end -+ return dir[i].toInt(); -+ } - } -- } -- return (-1); -+ return (-1); -+ #endif - } - - const char* getPassword(const char*) |