diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2017-04-20 16:55:28 -0600 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2017-04-20 16:59:56 -0600 |
commit | 823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b (patch) | |
tree | 63222010af3b90a36f29c1c9c360116973cdff38 /zen/process_priority.cpp | |
parent | add .gitattributes for less line ending hassles (diff) | |
download | FreeFileSync-823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b.tar.gz FreeFileSync-823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b.tar.bz2 FreeFileSync-823740e1ffa2b3bd39f8dea8062f5c5a0d9c741b.zip |
normalize most lineendings
Diffstat (limited to 'zen/process_priority.cpp')
-rwxr-xr-x | zen/process_priority.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/zen/process_priority.cpp b/zen/process_priority.cpp index 50c975fe..5767e60c 100755 --- a/zen/process_priority.cpp +++ b/zen/process_priority.cpp @@ -1,54 +1,54 @@ -// *****************************************************************************
-// * This file is part of the FreeFileSync project. It is distributed under *
-// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
-// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved *
-// *****************************************************************************
-
-#include "process_priority.h"
-#include "i18n.h"
-
-
-using namespace zen;
-
-
-struct PreventStandby::Impl {};
-PreventStandby::PreventStandby() {}
-PreventStandby::~PreventStandby() {}
-
-//solution for GNOME?: http://people.gnome.org/~mccann/gnome-session/docs/gnome-session.html#org.gnome.SessionManager.Inhibit
-
-struct ScheduleForBackgroundProcessing::Impl {};
-ScheduleForBackgroundProcessing::ScheduleForBackgroundProcessing() {};
-ScheduleForBackgroundProcessing::~ScheduleForBackgroundProcessing() {};
-
-/*
-struct ScheduleForBackgroundProcessing
-{
- - required functions ioprio_get/ioprio_set are not part of glibc: http://linux.die.net/man/2/ioprio_set
- - and probably never will: http://sourceware.org/bugzilla/show_bug.cgi?id=4464
- - /usr/include/linux/ioprio.h not available on Ubuntu, so we can't use it instead
-
- ScheduleForBackgroundProcessing() : oldIoPrio(getIoPriority(IOPRIO_WHO_PROCESS, ::getpid()))
- {
- if (oldIoPrio != -1)
- setIoPriority(::getpid(), IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
- }
- ~ScheduleForBackgroundProcessing()
- {
- if (oldIoPrio != -1)
- setIoPriority(::getpid(), oldIoPrio);
- }
-
-private:
- static int getIoPriority(pid_t pid)
- {
- return ::syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, pid);
- }
- static int setIoPriority(pid_t pid, int ioprio)
- {
- return ::syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, ioprio);
- }
-
- const int oldIoPrio;
-};
-*/
+// ***************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * +// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved * +// ***************************************************************************** + +#include "process_priority.h" +#include "i18n.h" + + +using namespace zen; + + +struct PreventStandby::Impl {}; +PreventStandby::PreventStandby() {} +PreventStandby::~PreventStandby() {} + +//solution for GNOME?: http://people.gnome.org/~mccann/gnome-session/docs/gnome-session.html#org.gnome.SessionManager.Inhibit + +struct ScheduleForBackgroundProcessing::Impl {}; +ScheduleForBackgroundProcessing::ScheduleForBackgroundProcessing() {}; +ScheduleForBackgroundProcessing::~ScheduleForBackgroundProcessing() {}; + +/* +struct ScheduleForBackgroundProcessing +{ + - required functions ioprio_get/ioprio_set are not part of glibc: http://linux.die.net/man/2/ioprio_set + - and probably never will: http://sourceware.org/bugzilla/show_bug.cgi?id=4464 + - /usr/include/linux/ioprio.h not available on Ubuntu, so we can't use it instead + + ScheduleForBackgroundProcessing() : oldIoPrio(getIoPriority(IOPRIO_WHO_PROCESS, ::getpid())) + { + if (oldIoPrio != -1) + setIoPriority(::getpid(), IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); + } + ~ScheduleForBackgroundProcessing() + { + if (oldIoPrio != -1) + setIoPriority(::getpid(), oldIoPrio); + } + +private: + static int getIoPriority(pid_t pid) + { + return ::syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, pid); + } + static int setIoPriority(pid_t pid, int ioprio) + { + return ::syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, ioprio); + } + + const int oldIoPrio; +}; +*/ |