diff options
author | Jan Synacek <jsynacek@redhat.com> | 2013-09-18 08:33:03 +0200 |
---|---|---|
committer | Jan Synacek <jsynacek@redhat.com> | 2013-09-18 15:19:30 +0200 |
commit | cd13c983a49ce3685a3813e66001bd3ea8f796c8 (patch) | |
tree | c79386678dbfdbfbdbbccb48d690f7cd3f475c50 /src/logicalfile/LMI_FIFOPipeFileProvider.c | |
parent | 2746832524f5e5d022b13ffa0890f895ab82355c (diff) | |
download | openlmi-providers-cd13c983a49ce3685a3813e66001bd3ea8f796c8.tar.gz openlmi-providers-cd13c983a49ce3685a3813e66001bd3ea8f796c8.tar.xz openlmi-providers-cd13c983a49ce3685a3813e66001bd3ea8f796c8.zip |
logicalfile: code cleanup and rewrite
GetInstance() calls were rewritten using cleaner code. Also, the macros
that were used before were either rewritten to functions, or cleaned up
so they wouldn't return or do anything unexpected.
Helper functions now use CMPIStatus more consistently.
Some memory leaks were fixed.
Diffstat (limited to 'src/logicalfile/LMI_FIFOPipeFileProvider.c')
-rw-r--r-- | src/logicalfile/LMI_FIFOPipeFileProvider.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/logicalfile/LMI_FIFOPipeFileProvider.c b/src/logicalfile/LMI_FIFOPipeFileProvider.c index 8730299..6179f16 100644 --- a/src/logicalfile/LMI_FIFOPipeFileProvider.c +++ b/src/logicalfile/LMI_FIFOPipeFileProvider.c @@ -61,7 +61,19 @@ static CMPIStatus LMI_FIFOPipeFileGetInstance( const CMPIObjectPath* cop, const char** properties) { - get_instance(FIFOPipeFile, S_IFIFO, "No such FIFO: %s"); + CMPIStatus st = {.rc = CMPI_RC_OK}; + logicalfile_t logicalfile; + + st = lmi_check_required(_cb, cop); + check_status(st); + + LMI_FIFOPipeFile_InitFromObjectPath(&logicalfile.lf.fifopipefile, _cb, cop); + st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFIFO, "No such FIFO: %s"); + check_status(st); + + KReturnInstance(cr, logicalfile.lf.fifopipefile); + return st; + CMReturn(CMPI_RC_OK); } @@ -145,3 +157,6 @@ KONKRET_REGISTRATION( "LMI_FIFOPipeFile", "instance method") /* vi: set et: */ +/* Local Variables: */ +/* indent-tabs-mode: nil */ +/* End: */ |