X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracweightedcommand.cpp;h=e7009322c66ba8df3a7838fca8073bbfcd0034dd;hb=aca78ed4a47dff8672ea8fd93cef0dfbaf0f7495;hp=1c146ac4d1b1168093cc6df20a8d37a930e1d56b;hpb=0c5f99d1282405e20458e2822aa1a54774d2fa83;p=mothur.git diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 1c146ac..e700932 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -768,7 +768,7 @@ int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > na #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) //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 @@ -778,7 +778,7 @@ int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > na //pass numSeqs to parent ofstream out; - string tempFile = outputDir + toString(getpid()) + ".weightedcommand.results.temp"; + string tempFile = outputDir + m->mothurGetpid(process) + ".weightedcommand.results.temp"; m->openOutputFile(tempFile, out); for (int i = lines[process].start; i < (lines[process].start + lines[process].num); i++) { out << scores[i][(scores[i].size()-1)] << '\t'; } out << endl; out.close();