mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 18:31:12 +02:00
Merge branch 'ni/tuxbox' into ni/mp/tuxbox
Conflicts:
configure.ac
src/driver/Makefile.am
src/driver/framebuffer.h
src/gui/bookmarkmanager.cpp
src/gui/filebrowser.cpp
src/gui/widget/buttons.cpp
src/system/httptool.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: dd6244f33e
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-02-09 (Thu, 09 Feb 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1393,12 +1393,12 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&)
|
||||
if (n < 0)
|
||||
return menu_return::RETURN_NONE;
|
||||
|
||||
const char hdidle[] = "/sbin/hd-idle";
|
||||
bool have_hdidle = !access(hdidle, X_OK);
|
||||
|
||||
if (g_settings.hdd_sleep > 0 && g_settings.hdd_sleep < 60)
|
||||
g_settings.hdd_sleep = 60;
|
||||
|
||||
const char hdidle[] = "/sbin/hd-idle";
|
||||
bool have_hdidle = !access(hdidle, X_OK);
|
||||
|
||||
if (have_hdidle) {
|
||||
system("kill $(pidof hd-idle)");
|
||||
int sleep_seconds = g_settings.hdd_sleep;
|
||||
@@ -1414,12 +1414,22 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&)
|
||||
}
|
||||
if (sleep_seconds)
|
||||
my_system(3, hdidle, "-i", to_string(sleep_seconds).c_str());
|
||||
|
||||
while (n--)
|
||||
free(namelist[n]);
|
||||
free(namelist);
|
||||
return menu_return::RETURN_NONE;
|
||||
}
|
||||
|
||||
const char hdparm[] = "/sbin/hdparm";
|
||||
bool have_hdparm = !access(hdparm, X_OK);
|
||||
if (!have_hdparm)
|
||||
{
|
||||
while (n--)
|
||||
free(namelist[n]);
|
||||
free(namelist);
|
||||
return menu_return::RETURN_NONE;
|
||||
}
|
||||
|
||||
struct stat stat_buf;
|
||||
bool have_nonbb_hdparm = !::lstat(hdparm, &stat_buf) && !S_ISLNK(stat_buf.st_mode);
|
||||
@@ -1433,12 +1443,11 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&)
|
||||
snprintf(M_opt, sizeof(M_opt), "-M%d", g_settings.hdd_noise);
|
||||
snprintf(opt, sizeof(opt), "/dev/%s",namelist[i]->d_name);
|
||||
|
||||
if (have_hdidle)
|
||||
my_system(3, hdparm, M_opt, opt);
|
||||
else if (have_nonbb_hdparm)
|
||||
if (have_nonbb_hdparm)
|
||||
my_system(4, hdparm, M_opt, S_opt, opt);
|
||||
else // busybox hdparm doesn't support "-M"
|
||||
my_system(3, hdparm, S_opt, opt);
|
||||
|
||||
free(namelist[i]);
|
||||
}
|
||||
free(namelist);
|
||||
|
Reference in New Issue
Block a user