diff options
author | Simon Rettberg | 2015-10-12 12:04:42 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-10-12 12:04:42 +0200 |
commit | 4660c5011610b5d4cfab7f074a5ae761484ed908 (patch) | |
tree | 85b5abaca54aa422a1ea40468fef2b6b869ea4a6 /src | |
parent | Update cmake file (diff) | |
download | printergui-4660c5011610b5d4cfab7f074a5ae761484ed908.tar.gz printergui-4660c5011610b5d4cfab7f074a5ae761484ed908.tar.xz printergui-4660c5011610b5d4cfab7f074a5ae761484ed908.zip |
[pwgui] Revert using cupsTempFile2 - has issues when running backend
Diffstat (limited to 'src')
-rw-r--r-- | src/pwgui/main.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp index 67f53e8..256dca3 100644 --- a/src/pwgui/main.cpp +++ b/src/pwgui/main.cpp @@ -6,7 +6,6 @@ #include <QDesktopWidget> #include <QLayout> #include <cups/backend.h> -#include <cups/cups.h> #include <fcntl.h> #include <sys/stat.h> #include <time.h> @@ -111,9 +110,7 @@ int main(int argc, char *argv[]) // Get document to print if (argc == 6) { // Data comes from stdin, save... - if (cupsTempFile2(tmpfile, NAMELEN) == NULL) { - snprintf(tmpfile, NAMELEN, "/tmp/print-%s-%d-%s-%d", argv[1], (int)time(NULL), argv[2], (int)getpid()); - } + snprintf(tmpfile, NAMELEN, "/tmp/print-%s-%d-%s-%d", argv[1], (int)time(NULL), argv[2], (int)getpid()); int fh = open(tmpfile, O_CREAT | O_WRONLY | O_TRUNC, 0600); if (fh < 0) { helper_messageBox("PrinterGUI", "Konnte temporäre Datei für den Druckjob nicht anlegen."); @@ -165,6 +162,7 @@ int main(int argc, char *argv[]) spoolres = run_backend(backend, device, argv[1], argv[2], argv[3], argv[4], argv[5], tmpfile, NULL); helper_killGui(); if (spoolres != CUPS_BACKEND_AUTH_REQUIRED) { + remove(tmpfile); return helper_cupsError(spoolres); // Yay } |