X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=countseqscommand.cpp;h=cfe8d27e2909d3174e37ce9a161764902e164f11;hb=a89c6295ae9a35fcaaab7fa50dcb68360dd543b0;hp=301aff7007c309d18952f04493188b9330b56f55;hpb=cbbf2f185fc7289910bb69421095c1de024c5225;p=mothur.git diff --git a/countseqscommand.cpp b/countseqscommand.cpp index 301aff7..cfe8d27 100644 --- a/countseqscommand.cpp +++ b/countseqscommand.cpp @@ -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