]> git.lyx.org Git - lyx.git/blobdiff - src/support/syscall.C
lyxserver cleanup patch + andre's small patches
[lyx.git] / src / support / syscall.C
index 6735aad5c22bf6ebfdfb4eefb49107a4d6851d25..60afc4293545cf498a58119a2240b5497e49452d 100644 (file)
 
 using std::endl;
 
+#ifndef CXX_GLOBAL_CSTD
+using std::strerror;
+#endif
+
 
 Systemcalls::Systemcalls() {
        pid = 0; // No child yet
@@ -110,7 +114,8 @@ void Systemcalls::waitForChild() {
        while (wait) {
                pid_t waitrpid = waitpid(pid, &status, WUNTRACED);
                if (waitrpid == -1) {
-                       lyxerr << "LyX: Error waiting for child:" << strerror(errno) << endl;
+                       lyxerr << "LyX: Error waiting for child:"
+                              << strerror(errno) << endl;
                        wait = false;
                } else if (WIFEXITED(status)) {
                        // Child exited normally. Update return value.
@@ -176,13 +181,15 @@ pid_t Systemcalls::fork()
 #ifndef __EMX__
                execvp(syscmd, argv);
                // If something goes wrong, we end up here:
-               lyxerr << "LyX: execvp failed: " << strerror(errno) << endl;
+               lyxerr << "LyX: execvp failed: "
+                      << strerror(errno) << endl;
        } else if (cpid < 0) { // error
 #else
        pid_t cpid = spawnvp(P_SESSION|P_DEFAULT|P_MINIMIZE|P_BACKGROUND, syscmd, argv);
        if (cpid < 0) { // error
 #endif
-               lyxerr << "LyX: Could not fork: " << strerror(errno) << endl;
+               lyxerr << "LyX: Could not fork: "
+                      << strerror(errno) << endl;
        } else { // parent
                return cpid;
        }
@@ -202,8 +209,11 @@ int Systemcalls::startscript(Starttype how, string const & what,
        retval  = 0;
 
        if (how == SystemDontWait) {
-               (os::shell() == os::UNIX) ? command += " &"
-                                         : command = "start /min/n " + command;
+               if (os::shell() == os::UNIX) {
+                       command += " &";
+               } else {
+                       command = "start /min/n " + command;
+               }
        }
 
         return startscript();