]> git.lyx.org Git - lyx.git/blobdiff - src/support/syscall.C
some new (not extensive) changes, some fixes, will probably reverto to .la libs later...
[lyx.git] / src / support / syscall.C
index c5c99eadead36a5b089b2d9fedcefef51a35e616..c12e755aa5ec9f38867b5776c52d6bb9c6ed8d88 100644 (file)
@@ -4,12 +4,11 @@
 #pragma implementation
 #endif
 
-#include <errno.h>
+#include <cerrno>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <signal.h>
+#include <csignal>
 #include <cstdlib>
-#include <cstdio>
 #include <unistd.h>
 #include "debug.h"
 #include "syscall.h"
@@ -17,7 +16,7 @@
 #include "support/lstrings.h"
 
 Systemcalls::Systemcalls() {
-       pid = (pid_t) 0; // No child yet
+       pid = 0; // No child yet
 }
 
 Systemcalls::Systemcalls(Starttype how, string const & what, Callbackfct cback)
@@ -25,7 +24,7 @@ Systemcalls::Systemcalls(Starttype how, string const & what, Callbackfct cback)
        start   = how;
        command = what;
        cbk     = cback;
-       pid     = (pid_t) 0;
+       pid     = static_cast<pid_t>(0);
        retval  = 0;
        startscript();
 }
@@ -73,7 +72,7 @@ int Systemcalls::startscript() {
        return retval;
 }
 
-void Systemcalls::kill(int tolerance) {
+void Systemcalls::kill(int /*tolerance*/) {
        if (getpid() == 0) {
                lyxerr << "LyX: Can't kill non-existing process." << endl;
                return;
@@ -92,7 +91,9 @@ void Systemcalls::kill(int tolerance) {
                // Here, we should add the PID to a list of
                // waiting processes to kill if they are not
                // dead without tolerance seconds
+#ifdef WITH_WARNINGS
 #warning Implement this using the timer of the singleton systemcontroller (Asger)
+#endif
        }
 }
 
@@ -181,7 +182,7 @@ int Systemcalls::startscript(Starttype how, string const & what,
        start   = how;
        command = what;
        cbk     = cback;
-       pid     = (pid_t) 0; // yet no child
+       pid     = static_cast<pid_t>(0); // yet no child
        retval  = 0;
         return startscript();
 }
@@ -207,7 +208,7 @@ int main(int, char**)
 {
        
        SystemcallsSingletoncontroller::Startcontroller starter; 
-       SystemcallsSingletoncontroller *contr=starter.GetController();
+       SystemcallsSingletoncontroller *contr= starter.GetController();
        
        Systemcalls one(Systemcalls::System, "ls -ltag", back);
        Systemcalls two(Systemcalls::Wait, "ls -ltag", back);