diff -ur globus_common-7.20.orig/library/globus_libc.c globus_common-7.20/library/globus_libc.c --- globus_common-7.20.orig/library/globus_libc.c 2005-04-19 00:59:31.000000000 +0200 +++ globus_common-7.20/library/globus_libc.c 2006-10-26 13:56:26.000000000 +0200 @@ -17,10 +17,10 @@ CVS Information: $Source: /home/globdev/CVS/globus-packages/common/source/library/globus_libc.c,v $ - $Date: 2005/04/18 22:59:31 $ - $Revision: 1.48 $ + $Date: 2006/10/03 23:13:57 $ + $Revision: 1.48.4.1 $ $State: Exp $ - $Author: mlink $ + $Author: kettimut $ ******************************************************************************/ /****************************************************************************** @@ -361,6 +361,26 @@ } /* globus_libc_write() */ /****************************************************************************** +Function: globus_libc_umask() + +Description: + +Parameters: + +Returns: +******************************************************************************/ +#undef globus_libc_umask +mode_t +globus_libc_umask(mode_t mask) +{ + mode_t oldmask; + globus_libc_lock(); + oldmask = umask(mask); + globus_libc_unlock(); + return(oldmask); +} /* globus_libc_umask */ + +/****************************************************************************** Function: globus_libc_fstat() Description: @@ -1071,6 +1091,13 @@ */ #if defined(TARGET_ARCH_WIN32) +/* As there isn't a equivalent of umask() for windows, this is a noop */ +mode_t +globus_libc_umask_win32(mode_t mask) +{ + return mask; +} + int globus_libc_system_memory( globus_off_t * mem) diff -ur globus_common-7.20.orig/library/globus_libc.h globus_common-7.20/library/globus_libc.h --- globus_common-7.20.orig/library/globus_libc.h 2005-04-19 00:59:31.000000000 +0200 +++ globus_common-7.20/library/globus_libc.h 2006-10-26 13:56:26.000000000 +0200 @@ -117,6 +117,7 @@ extern int globus_libc_write(int fd, char *buf, int nbytes); extern int globus_libc_writev(int fd, struct iovec *iov, int iovcnt); extern int globus_libc_fstat(int fd, struct stat *buf); +extern int globus_libc_umask(mode_t mask); extern DIR *globus_libc_opendir(char *filename); extern long globus_libc_telldir(DIR *dirp); @@ -130,6 +131,7 @@ #define globus_libc_close close #define globus_libc_read read #define globus_libc_write write +#define globus_libc_umask umask #if defined(HAVE_WRITEV) #define globus_libc_writev writev #else @@ -160,10 +162,17 @@ struct dirent ** result); #else /* TARGET_ARCH_WIN32 */ + +extern +mode_t +globus_libc_umask_win32( + mode_t mask); + # define globus_libc_open _open # define globus_libc_close _close # define globus_libc_read _read # define globus_libc_write _write +# define globus_libc_umask globus_libc_umask_win32 # define globus_libc_writev(fd,iov,iovcnt) \ write(fd,iov[0].iov_base,iov[0].iov_len) # define uid_t int