helpers: improve my_system function

Instead of hardcoding the maximum number of arguments to the
my_system helper, pass a variable argument list.
The function is deliberately source-incompatible with the old
implementation (as opposed to a variant with a sentinel NULL
argument, which would be compatible) to find all users and to
make sure that new future users of this function are not
overlooked during merges with other branches.

Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
This commit is contained in:
Stefan Seyfried
2013-03-03 19:18:13 +01:00
committed by Jacek Jendrzej
parent 22be19a9b0
commit 988a8ebec2
13 changed files with 55 additions and 35 deletions

View File

@@ -107,7 +107,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str
if (modus & RESET_UNLOAD) {
umount(mountPkt.c_str());
my_system("rmmod", mtdramDriver.c_str());
my_system(2,"rmmod", mtdramDriver.c_str());
}
if (modus & RESET_FD1)
close(fd1);
@@ -231,7 +231,7 @@ bool CExtUpdate::applySettings()
// load mtdram driver
snprintf(buf1, sizeof(buf1), "total_size=%d", mtdSize/1024);
snprintf(buf2, sizeof(buf2), "erase_size=%d", mtdEraseSize/1024);
my_system("insmod", mtdramDriver.c_str(), buf1, buf2);
my_system(4, "insmod", mtdramDriver.c_str(), buf1, buf2);
// check if mtdram driver is now loaded
if (!isMtdramLoad())
return ErrorReset(0, "error load mtdram driver");