-
Notifications
You must be signed in to change notification settings - Fork 36
Two small changes to make by default, OOTB, work better with msys2. #831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
10f2765
622beba
f42545a
67cb874
5c0d48a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -392,13 +392,13 @@ getuid(void) | |||||
|
||||||
if (!convertinit++ && (d = getenv(convertvars[0]))) | ||||||
for (e = environ; s = *e; e++) | ||||||
if ((n = convert(d, s)) && (m = cygwin_win32_to_posix_path_list_buf_size(s + n)) > 0) | ||||||
if ((n = convert(d, s)) && (m = conv_path_list_buf_size(s + n), true) > 0) | ||||||
{ | ||||||
if (!(t = malloc(n + m + 1))) | ||||||
break; | ||||||
*e = t; | ||||||
memcpy(t, s, n); | ||||||
cygwin_win32_to_posix_path_list(s + n, t + n); | ||||||
conv_last_list_buf_size(s + n, t + n, false); | ||||||
} | ||||||
return sysgetuid(); | ||||||
} | ||||||
|
@@ -557,13 +557,13 @@ runve(int mode, const char* path, char* const* argv, char* const* envv) | |||||
#if CONVERT | ||||||
if (!ux && (d = getenv(convertvars[0]))) | ||||||
for (p = (char**)envv; s = *p; p++) | ||||||
if ((n = convert(d, s)) && (m = cygwin_posix_to_win32_path_list_buf_size(s + n)) > 0) | ||||||
if ((n = convert(d, s)) && (m = conv_path_list_buf_size(s + n, true)) > 0) | ||||||
{ | ||||||
if (!(t = malloc(n + m + 1))) | ||||||
break; | ||||||
*p = t; | ||||||
memcpy(t, s, n); | ||||||
cygwin_posix_to_win32_path_list(s + n, t + n); | ||||||
conv_path_list_buf_size(s + n, t + n, false); | ||||||
} | ||||||
#endif | ||||||
} | ||||||
|
@@ -871,7 +871,8 @@ unlink(const char* path) | |||||
oerrno = errno; | ||||||
if (lstat(path, &st) || !S_ISREG(st.st_mode)) | ||||||
goto try_unlink; | ||||||
cygwin_conv_to_full_win32_path(path, nat); | ||||||
|
||||||
cygwin_conv_path(CCP_POSIX_TO_WIN_W | CCP_ABSOLUTE, path, nat, 0); | ||||||
if (!strncasecmp(nat + 1, ":\\temp\\", 7)) | ||||||
goto try_unlink; | ||||||
drive = nat[0]; | ||||||
|
@@ -1007,7 +1008,7 @@ ctime_now(const char* path) | |||||
|
||||||
if (sysstat(path, &fs) || (fs.st_mode & S_IWUSR) || syschmod(path, (fs.st_mode | S_IWUSR) & S_IPERM)) | ||||||
fs.st_mode = 0; | ||||||
cygwin_conv_to_win32_path(path, tmp); | ||||||
cygwin_conv_path(CCP_POSIX_TO_WIN_W | CCP_ABSOLUTE, path, tmp, 0); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Similar for the other calls to cygwin_conv_path. No idea where conv_path_list_buf_size (or conv_last_list_buf_size) come from. But if you need to convert a path list, you can use cygwin_conv_path_list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so it looks like these old deprecated functions were 32-bit only, and removed in cygwin/cygwin@3e917da |
||||||
hp = CreateFile(tmp, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); | ||||||
if (hp && hp != INVALID_HANDLE_VALUE) | ||||||
{ | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned this may be the wrong thing, ie for Cygwin, which does the opposite as MSYS2 (it bind mounts /usr/bin to point to /bin). Could we check HOSTTYPE at this point in the script?