summaryrefslogtreecommitdiffstats
path: root/opensuse/core/tdelibs.old/kdeprint-restart-cupsd.diff
blob: d464098eb5a5cfc35b19c71854fc1ee84fabecf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: kdeprint/cups/cupsdconf2/cupsddialog.cpp
===================================================================
--- kdeprint/cups/cupsdconf2/cupsddialog.cpp.orig
+++ kdeprint/cups/cupsdconf2/cupsddialog.cpp
@@ -45,6 +45,7 @@
 #include <kguiitem.h>
 #include <kprocess.h>
 
+#include <stdlib.h>
 #include <signal.h>
 #include <cups/cups.h>
 
@@ -205,15 +206,13 @@ bool CupsdDialog::restartServer(QString&
 	}
 	else
 	{
+		KProcess proc;
                 bool success = false;
                 if (getuid() == 0 )
-                        success = (::kill(serverPid, SIGHUP) == 0);
+                        proc << "rccups" << "force-reload";
                 else
-                {
-                        KProcess proc;
-                        proc << "kdesu" << "-c" << "kill -SIGHUP " + QString::number( serverPid );
-                        success = proc.start( KProcess::Block ) && proc.normalExit();
-                }
+                        proc << "kdesu" << "-c" << "rccups" << "force-reload";
+		success = proc.start( KProcess::Block ) && proc.normalExit();
                 if( !success )    
 			msg = i18n("Unable to restart CUPS server (pid = %1)").arg(serverPid);
 	}