[libvirt] [PATCH 1/2] Use ENAMETOOLONG if the the socket path is longer than UNIX_PATH_MAX

Guido Günther agx at sigxcpu.org
Wed Nov 2 21:30:54 UTC 2011


---
 src/rpc/virnetsocket.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index ab88e19..d832c53 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -327,7 +327,8 @@ int virNetSocketNewListenUNIX(const char *path,
 
     addr.data.un.sun_family = AF_UNIX;
     if (virStrcpyStatic(addr.data.un.sun_path, path) == NULL) {
-        virReportSystemError(ENOMEM, _("Path %s too long for unix socket"), path);
+        virReportSystemError(ENAMETOOLONG,
+                             _("Path %s too long for unix socket"), path);
         goto error;
     }
     if (addr.data.un.sun_path[0] == '@')
-- 
1.7.7




More information about the libvir-list mailing list