mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
util: Don't compile couple of unused function for Windows.
basename() and dir_name() are not used for Windows and won't work well if used. So put a '#ifndef _WIN32' around them to prevent future calls. test-file_name.c tests the above 2 functions. It makes sense to merge this single function file with test-util.c and then not compile it for Windows. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -772,6 +772,7 @@ all_slashes_name(const char *s)
|
||||
: ".");
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
/* Returns the directory name portion of 'file_name' as a malloc()'d string,
|
||||
* similar to the POSIX dirname() function but thread-safe. */
|
||||
char *
|
||||
@@ -813,6 +814,7 @@ base_name(const char *file_name)
|
||||
|
||||
return xmemdup0(file_name + start, end - start);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/* If 'file_name' starts with '/', returns a copy of 'file_name'. Otherwise,
|
||||
* returns an absolute path to 'file_name' considering it relative to 'dir',
|
||||
|
Reference in New Issue
Block a user