From 54a1cfb53616baeef103bd8e395768fc344b1cc6 Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Wed, 19 Feb 2014 11:33:09 -0800 Subject: [PATCH] socket-util: Describe fd for Windows. In windows there is no clear way to distinguish between a socket fd and a file fd. We use the function, describe_fd() mostly for debugging. For now, return a generic statement. Co-authored-by: Linda Sun Signed-off-by: Linda Sun Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- lib/socket-util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/socket-util.c b/lib/socket-util.c index 506de6d2d..861cd9d99 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -1241,6 +1241,7 @@ describe_fd(int fd) struct stat s; ds_init(&string); +#ifndef _WIN32 if (fstat(fd, &s)) { ds_put_format(&string, "fstat failed (%s)", ovs_strerror(errno)); } else if (S_ISSOCK(s.st_mode)) { @@ -1260,6 +1261,9 @@ describe_fd(int fd) put_fd_filename(&string, fd); #endif } +#else + ds_put_format(&string,"file descriptor"); +#endif /* _WIN32 */ return ds_steal_cstr(&string); } -- 2.43.0