diff options
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; } |