Skip to content

Commit

Permalink
in_calyptia_fleet: remove readklink for win32.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Nov 7, 2023
1 parent e5e293a commit ce2c2a7
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions plugins/in_calyptia_fleet/in_calyptia_fleet.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,29 +127,6 @@ static int is_link(const char *path) {
static int is_link(const char *path) {
return FLB_FALSE;
}

/* we include readlink just in case... and also so it can link. */
ssize_t readlink(const char *path, char *realpath, size_t srealpath) {
HANDLE hFile;
DWORD ret;

hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

if (hFile == INVALID_HANDLE_VALUE) {
return -1;
}

ret = GetFinalPathNameByHandleA(hFile, realpath, srealpath, VOLUME_NAME_NT);

if (ret < srealpath) {
CloseHandle(hFile);
return -1;
}

CloseHandle(hFile);
return ret;
}
#endif


Expand Down Expand Up @@ -989,34 +966,6 @@ static int get_calyptia_fleet_id_by_name(struct flb_in_calyptia_fleet_config *ct
return 0;
}

#ifdef FLB_SYSTEM_WINDOWS
#define link(a, b) CreateHardLinkA(b, a, 0)
#define symlink(a, b) CreateSymLinkA(b, a, 0)

ssize_t readlink(const char *path, char *realpath, size_t srealpath) {
HANDLE hFile;
DWORD ret;

hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);

if (hFile == INVALID_HANDLE_VALUE) {
return -1;
}

ret = GetFinalPathNameByHandleA(hFile, realpath, srealpath, VOLUME_NAME_NT);

if (ret < srealpath) {
CloseHandle(hFile);
return -1;
}

CloseHandle(hFile);
return ret;
}

#endif

#ifdef FLB_SYSTEM_WINDOWS
#define _mkdir(a, b) mkdir(a)
#else
Expand Down

0 comments on commit ce2c2a7

Please sign in to comment.