{"thread":{"id":"22045","subject":"[PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","startedAt":"2009-12-29T01:18:46Z","lastAt":"2009-12-31T14:20:09Z","messageCount":10,"participants":["Sebastian Schuberth","Johannes Sixt","Erik Faye-Lund","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"130432","messageId":"hhbldr$di8$1@ger.gmane.org","threadId":"22045","inReplyTo":null,"subject":"[PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2009-12-29T01:18:46Z","receivedAt":"2009-12-29T01:18:46Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n compat/mingw.h |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex b3d299f..af2f810 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -6,6 +6,7 @@\n  */\n \n typedef int pid_t;\n+typedef int uid_t;\n #define hstrerror strerror\n \n #define S_IFLNK    0120000 /* Symbolic link */\n@@ -75,17 +76,17 @@ static inline int symlink(const char *oldpath, const char *newpath)\n { errno = ENOSYS; return -1; }\n static inline int fchmod(int fildes, mode_t mode)\n { errno = ENOSYS; return -1; }\n-static inline int fork(void)\n+static inline pid_t fork(void)\n { errno = ENOSYS; return -1; }\n static inline unsigned int alarm(unsigned int seconds)\n { return 0; }\n static inline int fsync(int fd)\n { return 0; }\n-static inline int getppid(void)\n+static inline pid_t getppid(void)\n { return 1; }\n static inline void sync(void)\n {}\n-static inline int getuid()\n+static inline uid_t getuid()\n { return 1; }\n static inline struct passwd *getpwnam(const char *name)\n { return NULL; }\n@@ -117,7 +118,7 @@ static inline int mingw_unlink(const char *pathname)\n }\n #define unlink mingw_unlink\n \n-static inline int waitpid(pid_t pid, int *status, unsigned options)\n+static inline pid_t waitpid(pid_t pid, int *status, unsigned options)\n {\n \tif (options == 0)\n \t\treturn _cwait(status, pid, 0);\n@@ -158,7 +159,7 @@ int poll(struct pollfd *ufds, unsigned int nfds, int timeout);\n struct tm *gmtime_r(const time_t *timep, struct tm *result);\n struct tm *localtime_r(const time_t *timep, struct tm *result);\n int getpagesize(void);\t/* defined in MinGW's libgcc.a */\n-struct passwd *getpwuid(int uid);\n+struct passwd *getpwuid(uid_t uid);\n int setitimer(int type, struct itimerval *in, struct itimerval *out);\n int sigaction(int sig, struct sigaction *in, struct sigaction *out);\n int link(const char *oldpath, const char *newpath);\n-- \n1.6.5.rc2.13.g1be2\n"},{"id":"130479","messageId":"4B3A7000.4050308@kdbg.org","threadId":"22045","inReplyTo":"hhbldr$di8$1@ger.gmane.org","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-12-29T21:09:20Z","receivedAt":"2009-12-29T21:09:20Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Sebastian Schuberth schrieb:\n> MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility\n\nWhy this? Compatibility with what? What's the problem with the status quo?\n\n-- Hannes\n"},{"id":"130501","messageId":"bdca99240912291649h1c727072q3b1e4099cab426df@mail.gmail.com","threadId":"22045","inReplyTo":"4B3A7000.4050308@kdbg.org","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2009-12-30T00:49:20Z","receivedAt":"2009-12-30T00:49:20Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Tue, Dec 29, 2009 at 22:09, Johannes Sixt <j6t@kdbg.org> wrote:\n\n>> MinGW: Use pid_t more consequently, introduce uid_t for greater\n>> compatibility\n>\n> Why this? Compatibility with what? What's the problem with the status quo?\n\nI wanted to include Hany's Dos2Unix tool (hd2u) into msysGit. h2du\ndepends on libpopt, and either of the two requires the uid_t type, I\ndo not recall which. And while adding the missing uid_t, I felt it\nwould be right to actually use uid_t / pid_t in the function\nprototypes.\n\n-- \nSebastian Schuberth\n"},{"id":"130503","messageId":"40aa078e0912291655m57ea0081vddf3b64bf27e1d02@mail.gmail.com","threadId":"22045","inReplyTo":"bdca99240912291649h1c727072q3b1e4099cab426df@mail.gmail.com","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2009-12-30T00:55:57Z","receivedAt":"2009-12-30T00:55:57Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Wed, Dec 30, 2009 at 1:49 AM, Sebastian Schuberth\n<sschuberth@gmail.com> wrote:\n> On Tue, Dec 29, 2009 at 22:09, Johannes Sixt <j6t@kdbg.org> wrote:\n>\n>>> MinGW: Use pid_t more consequently, introduce uid_t for greater\n>>> compatibility\n>>\n>> Why this? Compatibility with what? What's the problem with the status quo?\n>\n> I wanted to include Hany's Dos2Unix tool (hd2u) into msysGit. h2du\n> depends on libpopt, and either of the two requires the uid_t type, I\n> do not recall which. And while adding the missing uid_t, I felt it\n> would be right to actually use uid_t / pid_t in the function\n> prototypes.\n>\n\nPerhaps I'm missing something here... why do you need to modify the\ngit-sources in order to include an external tool?\n\n-- \nErik \"kusma\" Faye-Lund\n"},{"id":"130506","messageId":"bdca99240912291716g74c35f22r7599f2c254fb1b09@mail.gmail.com","threadId":"22045","inReplyTo":"40aa078e0912291655m57ea0081vddf3b64bf27e1d02@mail.gmail.com","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2009-12-30T01:16:59Z","receivedAt":"2009-12-30T01:16:59Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Wed, Dec 30, 2009 at 01:55, Erik Faye-Lund <kusmabite@googlemail.com> wrote:\n\n>>> Why this? Compatibility with what? What's the problem with the status quo?\n>>\n>> I wanted to include Hany's Dos2Unix tool (hd2u) into msysGit. h2du\n>> depends on libpopt, and either of the two requires the uid_t type, I\n>> do not recall which. And while adding the missing uid_t, I felt it\n>> would be right to actually use uid_t / pid_t in the function\n>> prototypes.\n>\n> Perhaps I'm missing something here... why do you need to modify the\n> git-sources in order to include an external tool?\n\nBecause I'm building that external tool in the msysGit environment. As\nyou know, the way we include external tools (like vim, unzip etc.) to\nthe msysGit distribution is to create release.sh scripts that download\nthe sources, apply patches, and build the tool. Patching the original\nhd2u sources to include compat/mingw.h was the best way that I saw to\nget some required symbols, with only two symbols missing, and those\nmissing symbols are added by my patches.\n\nAnyway, IMHO the correct declaration of e.g. getuid() is not \"int\ngetuid()\", but \"uid_t getuid()\" etc. So even if the uid_t type was not\nrequired, it's a good change I think.\n\n-- \nSebastian Schuberth\n"},{"id":"130545","messageId":"alpine.DEB.1.00.0912301209310.4985@pacific.mpi-cbg.de","threadId":"22045","inReplyTo":"bdca99240912291716g74c35f22r7599f2c254fb1b09@mail.gmail.com","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-12-30T11:11:41Z","receivedAt":"2009-12-30T11:11:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 30 Dec 2009, Sebastian Schuberth wrote:\n\n> Anyway, IMHO the correct declaration of e.g. getuid() is not \"int \n> getuid()\", but \"uid_t getuid()\" etc. So even if the uid_t type was not \n> required, it's a good change I think.\n\nFWIW I concur with this reasoning.  Even if in this particular case, we \ncould work around the issue, it is basically a non-intrusive, minimal \njanitorial patch.  Especially since the original author of the wrong \nsignature concurs.\n\nCiao,\nDscho\n"},{"id":"130606","messageId":"4B3CAC2D.5050500@kdbg.org","threadId":"22045","inReplyTo":"bdca99240912291649h1c727072q3b1e4099cab426df@mail.gmail.com","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-12-31T13:50:37Z","receivedAt":"2009-12-31T13:50:37Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Sebastian Schuberth schrieb:\n> On Tue, Dec 29, 2009 at 22:09, Johannes Sixt <j6t@kdbg.org> wrote:\n> \n>>> MinGW: Use pid_t more consequently, introduce uid_t for greater\n>>> compatibility\n>> Why this? Compatibility with what? What's the problem with the status quo?\n> \n> I wanted to include Hany's Dos2Unix tool (hd2u) into msysGit.\n\nWe have dos2unix. What's wrong with it?\n\n-- Hannes\n"},{"id":"130607","messageId":"alpine.DEB.1.00.0912311511350.4985@pacific.mpi-cbg.de","threadId":"22045","inReplyTo":"4B3CAC2D.5050500@kdbg.org","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-12-31T14:12:58Z","receivedAt":"2009-12-31T14:12:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 31 Dec 2009, Johannes Sixt wrote:\n\n> Sebastian Schuberth schrieb:\n> > On Tue, Dec 29, 2009 at 22:09, Johannes Sixt <j6t@kdbg.org> wrote:\n> > \n> > > > MinGW: Use pid_t more consequently, introduce uid_t for greater\n> > > > compatibility\n> > > Why this? Compatibility with what? What's the problem with the status quo?\n> > \n> > I wanted to include Hany's Dos2Unix tool (hd2u) into msysGit.\n> \n> We have dos2unix. What's wrong with it?\n\nhd2u can handle mixed line endings, and it has a dry run mode IIUC.\n\nCiao,\nDscho\n"},{"id":"130608","messageId":"bdca99240912310614k46af8df1s181d258766c5a5ad@mail.gmail.com","threadId":"22045","inReplyTo":"alpine.DEB.1.00.0912311511350.4985@pacific.mpi-cbg.de","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2009-12-31T14:14:32Z","receivedAt":"2009-12-31T14:14:32Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On Thu, Dec 31, 2009 at 15:12, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n\n>> > I wanted to include Hany's Dos2Unix tool (hd2u) into msysGit.\n>>\n>> We have dos2unix. What's wrong with it?\n>\n> hd2u can handle mixed line endings, and it has a dry run mode IIUC.\n\nRight. One of the best features over dos2unix IMHO is that hd2u can\ndetect line-endings (and any problems like mixed / stray line-endings)\nwithout actually modifying any files. This makes it a very nice tool\nto detect any line-ending issues in the working tree of cross-platform\nprojects due to wrong autocrlf configurations.\n\n-- \nSebastian Schuberth\n"},{"id":"130609","messageId":"alpine.DEB.1.00.0912311518560.4985@pacific.mpi-cbg.de","threadId":"22045","inReplyTo":"alpine.DEB.1.00.0912311511350.4985@pacific.mpi-cbg.de","subject":"Re: [PATCH 1/2] MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-12-31T14:20:09Z","receivedAt":"2009-12-31T14:20:09Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 31 Dec 2009, Johannes Schindelin wrote:\n\n> On Thu, 31 Dec 2009, Johannes Sixt wrote:\n> \n> > Sebastian Schuberth schrieb:\n> > > On Tue, Dec 29, 2009 at 22:09, Johannes Sixt <j6t@kdbg.org> wrote:\n> > > \n> > > > > MinGW: Use pid_t more consequently, introduce uid_t for greater \n> > > > > compatibility\n> > > > Why this? Compatibility with what? What's the problem with the \n> > > > status quo?\n> > > \n> > > I wanted to include Hany's Dos2Unix tool (hd2u) into msysGit.\n> > \n> > We have dos2unix. What's wrong with it?\n> \n> hd2u can handle mixed line endings, and it has a dry run mode IIUC.\n\nHaving said that, I strongly feel this issue is over-discussed.  We'll \njust carry the necessary patches in 4msysgit.git and you can do what you \nwant.\n\nCiao,\nDscho\n"}]}