]> git.donarmstrong.com Git - mothur.git/blobdiff - bellerophon.cpp
changed int to pid_t type in fork(). roughed in get.mimarkscommand.
[mothur.git] / bellerophon.cpp
index 9dd21a4446e8d0ebd60ad7438dabe73d7a293128..59c70a0a6b45697c2dab20849587d27e55a05537 100644 (file)
@@ -314,7 +314,7 @@ int Bellerophon::getChimeras() {
        #else
        
                //divide breakpoints between processors
-               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
                        if(processors == 1){ 
                                lines.push_back(linePair(0, iters));    
                                
@@ -356,21 +356,21 @@ int Bellerophon::getChimeras() {
 
 int Bellerophon::createProcesses(vector<int> mid) {
        try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
                int process = 0;
                int exitCommand = 1;
                vector<int> processIDS;
                                
                //loop through and create all the processes you want
                while (process != processors) {
-                       int pid = fork();
+                       pid_t pid = fork();
                        
                        if (pid > 0) {
                                processIDS.push_back(pid);  //create map from line number to pid so you can append files in correct order later
                                process++;
                        }else if (pid == 0){
                                exitCommand = driverChimeras(mid, lines[process]);
-                               string tempOut = outputDir + toString(getpid()) + ".temp";
+                               string tempOut = outputDir + toString(m->mothurGetpid(process)) + ".temp";
                                writePrefs(tempOut, lines[process]);
                                exit(0);
                        }else {