Make test buildable both using a Makefile and CMake

Fix conditional commands
This commit is contained in:
Ahmed Yarub Hani Al Nuaimi
2021-09-04 22:16:17 -03:00
parent 01c77c34c4
commit eb2fa17582
4 changed files with 13 additions and 5 deletions

View File

@@ -64,8 +64,14 @@ char *kubeconfig_mk_cert_key_tempfile(const char *data)
return NULL;
}
#ifndef _WIN32
int rc = write(fd, cert_key_data, cert_key_data_bytes);
close(fd);
#else
int rc = _write(fd, cert_key_data, cert_key_data_bytes);
_close(fd);
#endif
if (true == is_data_base64_encoded && cert_key_data) {
free((char *) cert_key_data); // cast "const char *" to "char *"
cert_key_data = NULL;