[Libguestfs] [PATCH] daemon/Win32: Windows replacement for umask.

Richard W.M. Jones rjones at redhat.com
Wed Nov 25 18:54:51 UTC 2009


On Wed, Nov 25, 2009 at 06:49:41PM +0100, Jim Meyering wrote:
> Richard W.M. Jones wrote:
> > Subject: [PATCH 5/7] daemon/Win32: Windows replacement for umask.
> >
> > ---
> >  daemon/guestfsd.c |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
> > index 64cf87f..40b3c2f 100644
> > --- a/daemon/guestfsd.c
> > +++ b/daemon/guestfsd.c
> > @@ -182,8 +182,16 @@ main (int argc, char *argv[])
> >    setenv ("SHELL", "/bin/sh", 1);
> >    setenv ("LC_ALL", "C", 1);
> >
> > +#ifndef WIN32
> >    /* We document that umask defaults to 022 (it should be this anyway). */
> >    umask (022);
> > +#else
> > +  /* This is the default for Windows anyway.  It's not even clear if
> > +   * Windows ever uses this -- the MSDN documentation for the function
> > +   * contains obvious errors.
> > +   */
> > +  _umask (0);
> > +#endif
> 
> Same idea here:
> 
> #ifdef WIN32
> static inline mode_t
> umask (mode_t mode)
> {
>   _umask (0);
> }
> #endif

Windows, being Windows, has umask as well :-(

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the Libguestfs mailing list