From b1132d6b10cd3791b9529d7031d723fd0e2d8215 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 27 Dec 2015 18:39:47 +0900 Subject: make clang-format using clang-format-3.6 --- src/WatchProcessCommand.cc | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'src/WatchProcessCommand.cc') diff --git a/src/WatchProcessCommand.cc b/src/WatchProcessCommand.cc index 6c58d59d..d5067cb5 100644 --- a/src/WatchProcessCommand.cc +++ b/src/WatchProcessCommand.cc @@ -65,21 +65,16 @@ namespace aria2 { -WatchProcessCommand::WatchProcessCommand -(cuid_t cuid, - DownloadEngine* e, - unsigned int pid, - bool forceHalt) - : TimeBasedCommand(cuid, e, 1_s, true), - pid_(pid), - forceHalt_(forceHalt) -{} - +WatchProcessCommand::WatchProcessCommand(cuid_t cuid, DownloadEngine* e, + unsigned int pid, bool forceHalt) + : TimeBasedCommand(cuid, e, 1_s, true), pid_(pid), forceHalt_(forceHalt) +{ +} void WatchProcessCommand::preProcess() { - if(getDownloadEngine()->getRequestGroupMan()->downloadFinished() || - getDownloadEngine()->isHaltRequested()) { + if (getDownloadEngine()->getRequestGroupMan()->downloadFinished() || + getDownloadEngine()->isHaltRequested()) { enableExit(); } } @@ -102,10 +97,10 @@ void WatchProcessCommand::process() struct kinfo_proc kp; size_t len = sizeof(kp); - mib[0]=CTL_KERN; - mib[1]=KERN_PROC; - mib[2]=KERN_PROC_PID; - mib[3]=pid_; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = pid_; int ret = sysctl(mib, MIBSIZE, &kp, &len, nullptr, 0); if (ret == -1 || len <= 0) { @@ -116,13 +111,14 @@ void WatchProcessCommand::process() waiting = false; } #endif - if(!waiting) { - A2_LOG_INFO - (fmt("CUID#%" PRId64 " - Process %u is not running. Commencing shutdown.", - getCuid(), pid_)); - if(forceHalt_) { + if (!waiting) { + A2_LOG_INFO(fmt("CUID#%" PRId64 + " - Process %u is not running. Commencing shutdown.", + getCuid(), pid_)); + if (forceHalt_) { getDownloadEngine()->requestForceHalt(); - } else { + } + else { getDownloadEngine()->requestHalt(); } enableExit(); -- cgit