diff options
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 } |