]> git.donarmstrong.com Git - mothur.git/blobdiff - countseqscommand.cpp
update .gitignore
[mothur.git] / countseqscommand.cpp
index 301aff7007c309d18952f04493188b9330b56f55..cfe8d27e2909d3174e37ce9a161764902e164f11 100644 (file)
@@ -427,16 +427,16 @@ int CountSeqsCommand::createProcesses(GroupMap*& groupMap, string outputFileName
                
                //loop through and create all the processes you want
                while (process != processors-1) {
-                       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){
-                string filename = toString(getpid()) + ".temp";
+                string filename = m->mothurGetpid(process) + ".temp";
                                numSeqs = driver(lines[process].start, lines[process].end, filename, groupMap);
                 
-                string tempFile = toString(getpid()) + ".num.temp";
+                string tempFile = m->mothurGetpid(process) + ".num.temp";
                 ofstream outTemp;
                 m->openOutputFile(tempFile, outTemp);
                 
@@ -451,7 +451,7 @@ int CountSeqsCommand::createProcesses(GroupMap*& groupMap, string outputFileName
                        }
                }
                
-               string filename = toString(getpid()) + ".temp";
+               string filename = m->mothurGetpid(process) + ".temp";
         numSeqs = driver(lines[processors-1].start, lines[processors-1].end, filename, groupMap);
         
                //force parent to wait until all the processes are done