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_UnixSocketProvider.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_UnixSocketProvider.c')
-rw-r--r-- | src/logicalfile/LMI_UnixSocketProvider.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/logicalfile/LMI_UnixSocketProvider.c b/src/logicalfile/LMI_UnixSocketProvider.c index 56fb6bd..ca12d53 100644 --- a/src/logicalfile/LMI_UnixSocketProvider.c +++ b/src/logicalfile/LMI_UnixSocketProvider.c @@ -61,8 +61,18 @@ static CMPIStatus LMI_UnixSocketGetInstance( const CMPIObjectPath* cop, const char** properties) { - get_instance(UnixSocket, S_IFSOCK, "No such socket: %s"); - CMReturn(CMPI_RC_OK); + CMPIStatus st = {.rc = CMPI_RC_OK}; + logicalfile_t logicalfile; + + st = lmi_check_required(_cb, cop); + check_status(st); + + LMI_UnixSocket_InitFromObjectPath(&logicalfile.lf.unixsocket, _cb, cop); + st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFSOCK, "No such socket: %s"); + check_status(st); + + KReturnInstance(cr, logicalfile.lf.unixsocket); + return st; } static CMPIStatus LMI_UnixSocketCreateInstance( @@ -145,3 +155,6 @@ KONKRET_REGISTRATION( "LMI_UnixSocket", "instance method") /* vi: set et: */ +/* Local Variables: */ +/* indent-tabs-mode: nil */ +/* End: */ |