return -1;
}
- if ((attr = GetFileAttributesW(wsrc)) != -1) {
+ if ((attr = GetFileAttributesW(wsrc)) != (DWORD)-1) {
res = la_CreateHardLinkW(wdst, wsrc);
} else {
/* wsrc does not exist; try src prepend it with the dirname of wdst */
wcsncat(wnewsrc, wsrc, n);
/* Check again */
attr = GetFileAttributesW(wnewsrc);
- if (attr == -1 || (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
- if (attr == -1)
+ if (attr == (DWORD)-1 || (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
+ if (attr == (DWORD)-1)
la_dosmaperr(GetLastError());
else
errno = EPERM;
* "Permission denied" error.
*/
attr = GetFileAttributesA(path);
- if (attr == -1 && GetLastError() == ERROR_PATH_NOT_FOUND) {
+ if (attr == (DWORD)-1 && GetLastError() == ERROR_PATH_NOT_FOUND) {
ws = permissive_name(path);
if (ws == NULL) {
errno = EINVAL;
}
attr = GetFileAttributesW(ws);
}
- if (attr == -1) {
+ if (attr == (DWORD)-1) {
la_dosmaperr(GetLastError());
free(ws);
return (-1);
if (r < 0 && errno == EACCES && (flags & O_CREAT) != 0) {
/* simular other POSIX system action to pass a test */
attr = GetFileAttributesA(path);
- if (attr == -1)
+ if (attr == (DWORD)-1)
la_dosmaperr(GetLastError());
else if (attr & FILE_ATTRIBUTE_DIRECTORY)
errno = EISDIR;
if (r < 0 && errno == EACCES && (flags & O_CREAT) != 0) {
/* simular other POSIX system action to pass a test */
attr = GetFileAttributesW(ws);
- if (attr == -1)
+ if (attr == (DWORD)-1)
la_dosmaperr(GetLastError());
else if (attr & FILE_ATTRIBUTE_DIRECTORY)
errno = EISDIR;
ctx->valid = 0;
if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
- if (GetLastError() != NTE_BAD_KEYSET)
+ if (GetLastError() != (DWORD)NTE_BAD_KEYSET)
return;
if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
PROV_RSA_FULL, CRYPT_NEWKEYSET))