mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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 <lsun@vmware.com> Signed-off-by: Linda Sun <lsun@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user