| 672 | } |
| 673 | |
| 674 | U32 KProcess::alarm(U32 seconds) { |
| 675 | U32 prev = this->timer.millies; |
| 676 | if (seconds == 0) { |
| 677 | if (this->timer.millies!=0) { |
| 678 | removeTimer(&this->timer); |
| 679 | this->timer.millies = 0; |
| 680 | } |
| 681 | } else { |
| 682 | this->timer.resetMillies = 0; |
| 683 | if (this->timer.millies!=0) { |
| 684 | this->timer.millies = seconds*1000 + KSystem::getMilliesSinceStart(); |
| 685 | } else { |
| 686 | this->timer.millies = seconds*1000 + KSystem::getMilliesSinceStart(); |
| 687 | addTimer(&this->timer); |
| 688 | } |
| 689 | } |
| 690 | if (prev) { |
| 691 | return (prev - KSystem::getMilliesSinceStart())/1000; |
| 692 | } |
| 693 | return 0; |
| 694 | } |
| 695 | |
| 696 | std::shared_ptr<FsNode> KProcess::findInPath(BString path) { |
| 697 | std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(this->currentDirectory, path, true); |
no test coverage detected