[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: f_basic.c



  User: cnieves 
  Date: 07/06/09 11:38:37

  Modified:    .        f_basic.c
  Log:
  Fix for lack of permission-related file attributes on MinGW.
  
  
  
  Applied patch #1733728, with some tweaks, from Cesar Strauss. Thanks.
  
  Define some file permissions as 0 if they are not defined.
  
  Don't use chown if it is not available.
  
  
  
  
  Revision  Changes    Path
  1.21                 eda/geda/gaf/libgeda/src/f_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: f_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/f_basic.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- f_basic.c	10 Feb 2007 21:25:34 -0000	1.20
  +++ f_basic.c	9 Jun 2007 15:38:37 -0000	1.21
  @@ -338,6 +338,7 @@
       saved_umask = umask(0);
       st.st_mode = 0666 & ~saved_umask;
       umask(saved_umask);
  +#ifdef HAVE_CHOWN
       st.st_uid = getuid ();
       
       result = stat (dirname, &dir_st);
  @@ -346,6 +347,7 @@
   	  st.st_gid = dir_st.st_gid;
       else
       st.st_gid = getgid ();
  +#endif /* HAVE_CHOWN */
     }
     g_free (dirname);
     g_free (only_filename);
  @@ -361,7 +363,9 @@
   
       /* Restore permissions. */
       chmod (real_filename, st.st_mode);
  +#ifdef HAVE_CHOWN
       chown (real_filename, st.st_uid, st.st_gid);
  +#endif
   
       g_free (real_filename);
       return 1;
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs