diff options
author | David Sommerseth <davids@redhat.com> | 2009-06-12 18:17:19 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-06-12 18:17:19 +0200 |
commit | 4f46bece8a32378062857da9d740fcee17ffc246 (patch) | |
tree | f98268da023b7683d986bf17a4ad02dbf702da0f /src | |
parent | 27f81037d82585b29ed09db2f6d7ed1e30db7dd1 (diff) | |
download | python-dmidecode-4f46bece8a32378062857da9d740fcee17ffc246.tar.gz python-dmidecode-4f46bece8a32378062857da9d740fcee17ffc246.tar.xz python-dmidecode-4f46bece8a32378062857da9d740fcee17ffc246.zip |
Fixed error in dumping DMI/SMBIOS data to disk
Diffstat (limited to 'src')
-rw-r--r-- | src/dmidecodemodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |