From 4f46bece8a32378062857da9d740fcee17ffc246 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 12 Jun 2009 18:17:19 +0200 Subject: Fixed error in dumping DMI/SMBIOS data to disk --- src/dmidecodemodule.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dmidecodemodule.c b/src/dmidecodemodule.c index 0d92612..7e7d0a3 100644 --- a/src/dmidecodemodule.c +++ b/src/dmidecodemodule.c @@ -566,9 +566,11 @@ static PyObject *dmidecode_dump(PyObject * self, PyObject * null) f = (global_options->dumpfile ? global_options->dumpfile : global_options->devmem); stat(f, &_buf); - if((access(f, F_OK) != 0) || ((access(f, W_OK) == 0) && S_ISREG(_buf.st_mode))) - if(dump(PyString_AS_STRING(global_options->dumpfile))) + if( (access(f, F_OK) != 0) || ((access(f, W_OK) == 0) && S_ISREG(_buf.st_mode)) ) { + if( dump(f) ) { Py_RETURN_TRUE; + } + } Py_RETURN_FALSE; } -- cgit