aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Schuberth <sschuberth@gmail.com>2009-12-28 18:04:21 +0100
committerPat Thoyts <patthoyts@users.sourceforge.net>2010-10-01 23:08:42 +0100
commite7cf4e94c6f147953af4d079ca2e9ef0d7a29ae9 (patch)
tree1707de53d10658a81b78e3c7d2be93ecc792dcb5
parent1e633418479926bc85ed21a4f91c845a3dd3ad66 (diff)
downloadgit-e7cf4e94c6f147953af4d079ca2e9ef0d7a29ae9.tar.gz
git-e7cf4e94c6f147953af4d079ca2e9ef0d7a29ae9.tar.xz
MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
-rw-r--r--compat/mingw.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 3b2477be5..912c4256f 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -6,6 +6,7 @@
*/
typedef int pid_t;
+typedef int uid_t;
#define hstrerror strerror
#define S_IFLNK 0120000 /* Symbolic link */
@@ -75,17 +76,17 @@ static inline int symlink(const char *oldpath, const char *newpath)
{ errno = ENOSYS; return -1; }
static inline int fchmod(int fildes, mode_t mode)
{ errno = ENOSYS; return -1; }
-static inline int fork(void)
+static inline pid_t fork(void)
{ errno = ENOSYS; return -1; }
static inline unsigned int alarm(unsigned int seconds)
{ return 0; }
static inline int fsync(int fd)
{ return _commit(fd); }
-static inline int getppid(void)
+static inline pid_t getppid(void)
{ return 1; }
static inline void sync(void)
{}
-static inline int getuid()
+static inline uid_t getuid(void)
{ return 1; }
static inline struct passwd *getpwnam(const char *name)
{ return NULL; }
@@ -117,7 +118,7 @@ static inline int mingw_unlink(const char *pathname)
}
#define unlink mingw_unlink
-static inline int waitpid(pid_t pid, int *status, unsigned options)
+static inline pid_t waitpid(pid_t pid, int *status, unsigned options)
{
if (options == 0)
return _cwait(status, pid, 0);
@@ -158,7 +159,7 @@ int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
struct tm *gmtime_r(const time_t *timep, struct tm *result);
struct tm *localtime_r(const time_t *timep, struct tm *result);
int getpagesize(void); /* defined in MinGW's libgcc.a */
-struct passwd *getpwuid(int uid);
+struct passwd *getpwuid(uid_t uid);
int setitimer(int type, struct itimerval *in, struct itimerval *out);
int sigaction(int sig, struct sigaction *in, struct sigaction *out);
int link(const char *oldpath, const char *newpath);