mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
windows: return NULL in xreadlink
readlink does not exist on Windows. While we could skip the function all togheter on Windows, we may add support for it later on. For the moment return change errno to ENOENT and return NULL. FYI: https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/#kBeZetM7P1dorllZ.97 https://msdn.microsoft.com/en-us/library/windows/desktop/aa365680(v=vs.85).aspx Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -980,6 +980,10 @@ abs_file_name(const char *dir, const char *file_name)
|
||||
static char *
|
||||
xreadlink(const char *filename)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
errno = ENOENT;
|
||||
return NULL;
|
||||
#else
|
||||
size_t size;
|
||||
|
||||
for (size = 64; ; size *= 2) {
|
||||
@@ -998,6 +1002,7 @@ xreadlink(const char *filename)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Returns a version of 'filename' with symlinks in the final component
|
||||
|
Reference in New Issue
Block a user