提交 915bc742 编写于 作者: M Matthias Bolte

Remove two unused PATH_MAX-sized char arrays from the stack

上级 e065e1ea
...@@ -127,9 +127,9 @@ storageDriverAutostart(virStorageDriverStatePtr driver) { ...@@ -127,9 +127,9 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
* Initialization function for the QEmu daemon * Initialization function for the QEmu daemon
*/ */
static int static int
storageDriverStartup(int privileged) { storageDriverStartup(int privileged)
{
char *base = NULL; char *base = NULL;
char driverConf[PATH_MAX];
if (VIR_ALLOC(driverState) < 0) if (VIR_ALLOC(driverState) < 0)
return -1; return -1;
...@@ -160,11 +160,6 @@ storageDriverStartup(int privileged) { ...@@ -160,11 +160,6 @@ storageDriverStartup(int privileged) {
/* Configuration paths are either ~/.libvirt/storage/... (session) or /* Configuration paths are either ~/.libvirt/storage/... (session) or
* /etc/libvirt/storage/... (system). * /etc/libvirt/storage/... (system).
*/ */
if (snprintf (driverConf, sizeof(driverConf),
"%s/storage.conf", base) == -1)
goto out_of_memory;
driverConf[sizeof(driverConf)-1] = '\0';
if (virAsprintf(&driverState->configDir, if (virAsprintf(&driverState->configDir,
"%s/storage", base) == -1) "%s/storage", base) == -1)
goto out_of_memory; goto out_of_memory;
...@@ -175,13 +170,6 @@ storageDriverStartup(int privileged) { ...@@ -175,13 +170,6 @@ storageDriverStartup(int privileged) {
VIR_FREE(base); VIR_FREE(base);
/*
if (virStorageLoadDriverConfig(driver, driverConf) < 0) {
virStorageDriverShutdown();
return -1;
}
*/
if (virStoragePoolLoadAllConfigs(&driverState->pools, if (virStoragePoolLoadAllConfigs(&driverState->pools,
driverState->configDir, driverState->configDir,
driverState->autostartDir) < 0) driverState->autostartDir) < 0)
......
...@@ -342,10 +342,10 @@ cleanup: ...@@ -342,10 +342,10 @@ cleanup:
* Initialization function for the Uml daemon * Initialization function for the Uml daemon
*/ */
static int static int
umlStartup(int privileged) { umlStartup(int privileged)
{
uid_t uid = geteuid(); uid_t uid = geteuid();
char *base = NULL; char *base = NULL;
char driverConf[PATH_MAX];
char *userdir = NULL; char *userdir = NULL;
if (VIR_ALLOC(uml_driver) < 0) if (VIR_ALLOC(uml_driver) < 0)
...@@ -398,10 +398,6 @@ umlStartup(int privileged) { ...@@ -398,10 +398,6 @@ umlStartup(int privileged) {
/* Configuration paths are either ~/.libvirt/uml/... (session) or /* Configuration paths are either ~/.libvirt/uml/... (session) or
* /etc/libvirt/uml/... (system). * /etc/libvirt/uml/... (system).
*/ */
if (snprintf (driverConf, sizeof(driverConf), "%s/uml.conf", base) == -1)
goto out_of_memory;
driverConf[sizeof(driverConf)-1] = '\0';
if (virAsprintf(&uml_driver->configDir, "%s/uml", base) == -1) if (virAsprintf(&uml_driver->configDir, "%s/uml", base) == -1)
goto out_of_memory; goto out_of_memory;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册