Skip to content

Commit

Permalink
libkvs/commit: Cleanup flux_kvs_commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Aug 18, 2017
1 parent 0c8ea39 commit 1284050
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/common/libkvs/kvs_commit.c
Expand Up @@ -61,18 +61,15 @@ flux_future_t *flux_kvs_commit (flux_t *h, int flags, flux_kvs_txn_t *txn)
{
zuuid_t *uuid;
flux_future_t *f = NULL;
int saved_errno;
int saved_errno = 0;

if (!(uuid = zuuid_new ())
|| !(f = flux_kvs_fence (h, flags, zuuid_str (uuid), 1, txn)))
saved_errno = errno;

if (!(uuid = zuuid_new ())) {
errno = ENOMEM;
goto done;
}
if (!(f = flux_kvs_fence (h, flags, zuuid_str (uuid), 1, txn)))
goto done;
done:
saved_errno = errno;
zuuid_destroy (&uuid);
errno = saved_errno;
if (saved_errno)
errno = saved_errno;
return f;
}

Expand Down

0 comments on commit 1284050

Please sign in to comment.