Re: [PATCH] Remove two unused PATH_MAX-sized char arrays from the stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/1/17 Daniel P. Berrange <berrange@xxxxxxxxxx>:
> On Sun, Jan 16, 2011 at 12:05:32AM +0100, Matthias Bolte wrote:
>> ---
>> Âsrc/storage/storage_driver.c | Â 16 ++--------------
>> Âsrc/uml/uml_driver.c     |  Â8 ++------
>> Â2 files changed, 4 insertions(+), 20 deletions(-)
>>
>> diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
>> index 67d043b..5373025 100644
>> --- a/src/storage/storage_driver.c
>> +++ b/src/storage/storage_driver.c
>> @@ -127,9 +127,9 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
>> Â * Initialization function for the QEmu daemon
>> Â */
>> Âstatic int
>> -storageDriverStartup(int privileged) {
>> +storageDriverStartup(int privileged)
>> +{
>> Â Â Âchar *base = NULL;
>> - Â Âchar driverConf[PATH_MAX];
>>
>> Â Â Âif (VIR_ALLOC(driverState) < 0)
>> Â Â Â Â Âreturn -1;
>> @@ -160,11 +160,6 @@ storageDriverStartup(int privileged) {
>> Â Â Â/* Configuration paths are either ~/.libvirt/storage/... (session) or
>> Â Â Â * /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,
>> Â Â Â Â Â Â Â Â Â Â Â"%s/storage", base) == -1)
>> Â Â Â Â Âgoto out_of_memory;
>> @@ -175,13 +170,6 @@ storageDriverStartup(int privileged) {
>>
>> Â Â ÂVIR_FREE(base);
>>
>> - Â Â/*
>> - Â Âif (virStorageLoadDriverConfig(driver, driverConf) < 0) {
>> - Â Â Â ÂvirStorageDriverShutdown();
>> - Â Â Â Âreturn -1;
>> - Â Â}
>> - Â Â*/
>> -
>> Â Â Âif (virStoragePoolLoadAllConfigs(&driverState->pools,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â driverState->configDir,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â driverState->autostartDir) < 0)
>> diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
>> index 57f50f6..ef2a5b6 100644
>> --- a/src/uml/uml_driver.c
>> +++ b/src/uml/uml_driver.c
>> @@ -342,10 +342,10 @@ cleanup:
>> Â * Initialization function for the Uml daemon
>> Â */
>> Âstatic int
>> -umlStartup(int privileged) {
>> +umlStartup(int privileged)
>> +{
>> Â Â Âuid_t uid = geteuid();
>> Â Â Âchar *base = NULL;
>> - Â Âchar driverConf[PATH_MAX];
>> Â Â Âchar *userdir = NULL;
>>
>> Â Â Âif (VIR_ALLOC(uml_driver) < 0)
>> @@ -398,10 +398,6 @@ umlStartup(int privileged) {
>> Â Â Â/* Configuration paths are either ~/.libvirt/uml/... (session) or
>> Â Â Â * /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)
>> Â Â Â Â Âgoto out_of_memory;
>
> ACK
>
> Daniel
>

Thanks, I've pushed the 8 ACKed patches.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]