{"thread":{"id":"15686","subject":"[PATCH 1/4] mingw: remove use of _getdrive() from lstat/fstat","startedAt":"2008-09-27T08:39:45Z","lastAt":"2008-09-27T19:38:10Z","messageCount":2,"participants":["Dmitry Potapov","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"91734","messageId":"20080927083945.GZ21650@dpotapov.dyndns.org","threadId":"15686","inReplyTo":null,"subject":"[PATCH 1/4] mingw: remove use of _getdrive() from lstat/fstat","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2008-09-27T08:39:45Z","receivedAt":"2008-09-27T08:39:45Z","isPatch":true,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"The field device is not used by Git, and putting the number of the\ncurrent device is meaningless anyway.\n\nSigned-off-by: Dmitry Potapov <dpotapov@gmail.com>\n---\n compat/mingw.c |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex ccfa2a0..a2b8cd7 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -31,7 +31,6 @@ static inline time_t filetime_to_time_t(const FILETIME *ft)\n \treturn (time_t)winTime;\n }\n \n-extern int _getdrive( void );\n /* We keep the do_lstat code in a separate function to avoid recursion.\n  * When a path ends with a slash, the stat will fail with ENOENT. In\n  * this case, we strip the trailing slashes and stat again.\n@@ -55,7 +54,7 @@ static int do_lstat(const char *file_name, struct stat *buf)\n \t\tbuf->st_nlink = 1;\n \t\tbuf->st_mode = fMode;\n \t\tbuf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */\n-\t\tbuf->st_dev = buf->st_rdev = (_getdrive() - 1);\n+\t\tbuf->st_dev = buf->st_rdev = 0; /* not used by Git */\n \t\tbuf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));\n \t\tbuf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));\n \t\tbuf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));\n@@ -145,7 +144,7 @@ int mingw_fstat(int fd, struct stat *buf)\n \t\tbuf->st_nlink = 1;\n \t\tbuf->st_mode = fMode;\n \t\tbuf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */\n-\t\tbuf->st_dev = buf->st_rdev = (_getdrive() - 1);\n+\t\tbuf->st_dev = buf->st_rdev = 0; /* not used by Git */\n \t\tbuf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));\n \t\tbuf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));\n \t\tbuf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));\n-- \n1.6.0.2.237.g0297e5\n"},{"id":"91748","messageId":"200809272138.11305.johannes.sixt@telecom.at","threadId":"15686","inReplyTo":"20080927083945.GZ21650@dpotapov.dyndns.org","subject":"Re: [PATCH 1/4] mingw: remove use of _getdrive() from lstat/fstat","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2008-09-27T19:38:10Z","receivedAt":"2008-09-27T19:38:10Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Samstag, 27. September 2008, Dmitry Potapov wrote:\n> The field device is not used by Git, and putting the number of the\n> current device is meaningless anyway.\n\nAcked-by: Johannes Sixt <johannes.sixt@telecom.at>\n\n-- Hannes\n"}]}