diff options
author | swapnili <swapnil.ingle@nutanix.com> | 2020-09-23 15:02:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-23 15:02:20 +0200 |
commit | 03fbee40c5d7256afdb34e7c0f59964dd859320b (patch) | |
tree | 8e098c24777d5d8748b147c3980fa18a3872f54c | |
parent | 2a7005c683c9768484bd791107a4edf6f9bab46d (diff) | |
parent | 17a9c9c1e8a7b53a49d6fe785b76fc7bb7616bb5 (diff) | |
download | libvfio-user-03fbee40c5d7256afdb34e7c0f59964dd859320b.zip libvfio-user-03fbee40c5d7256afdb34e7c0f59964dd859320b.tar.gz libvfio-user-03fbee40c5d7256afdb34e7c0f59964dd859320b.tar.bz2 |
Merge pull request #59 from swapnili/vfio-user
Fix catching error from init_sock
-rw-r--r-- | lib/libmuser.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libmuser.c b/lib/libmuser.c index c08b9ac..7e5a12d 100644 --- a/lib/libmuser.c +++ b/lib/libmuser.c @@ -179,8 +179,7 @@ init_sock(lm_ctx_t *lm_ctx) iommu_grp = strtoul(basename(lm_ctx->uuid), &endptr, 10); if (*endptr != '\0' || (iommu_grp == ULONG_MAX && errno == ERANGE)) { - errno = EINVAL; - return -errno; + return -EINVAL; } lm_ctx->iommu_dir = strdup(lm_ctx->uuid); @@ -1988,8 +1987,7 @@ lm_ctx_create(const lm_dev_info_t *dev_info) if (transports_ops[dev_info->trans].init != NULL) { err = transports_ops[dev_info->trans].init(lm_ctx); - if (err == -1) { - err = errno; + if (err < 0) { goto out; } lm_ctx->fd = err; |