[GRASS-SVN] r38759 - grass/branches/develbranch_6/raster/r.li/r.li.daemon

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 17 00:47:28 EDT 2009


Author: hamish
Date: 2009-08-17 00:47:26 -0400 (Mon, 17 Aug 2009)
New Revision: 38759

Modified:
   grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
Log:
use G_home(), output text file as umask 0644 (meh)

Modified: grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2009-08-17 04:22:17 UTC (rev 38758)
+++ grass/branches/develbranch_6/raster/r.li/r.li.daemon/daemon.c	2009-08-17 04:47:26 UTC (rev 38759)
@@ -101,7 +101,7 @@
        ######################################################### */
 
     /* TODO: check if this path is portable */
-    sprintf(pathSetup, "%s/.r.li/history/%s", getenv("HOME"), file);
+    sprintf(pathSetup, "%s/.r.li/history/%s", G_home(), file);
     G_debug(1, "r.li.daemon pathSetup: %s", pathSetup);
     parsed = parseSetup(pathSetup, l, g, raster);
 
@@ -123,20 +123,20 @@
 	    G_fatal_error(_("Cannot create random access file"));
     }
     else {
-	/*check if ~/.r.li/output exist */
-	sprintf(out, "%s/.r.li/", getenv("HOME"));
+	/* check if ~/.r.li/output exists */
+	sprintf(out, "%s/.r.li/", G_home());
 
 	doneDir = G_mkdir(out);
 	if (doneDir == -1 && errno != EEXIST)
 	    G_fatal_error(_("Cannot create %s/.r.li/ directory"),
-			  getenv("HOME"));
-	sprintf(out, "%s/.r.li/output", getenv("HOME"));
+			  G_home());
+	sprintf(out, "%s/.r.li/output", G_home());
 	doneDir = G_mkdir(out);
 	if (doneDir == -1 && errno != EEXIST)
 	    G_fatal_error(_("Cannot create %s/.r.li/output/ directory"),
-			  getenv("HOME"));
-	sprintf(out, "%s/.r.li/output/%s", getenv("HOME"), output);
-	res = open(out, O_WRONLY | O_CREAT | O_TRUNC, 0755);
+			  G_home());
+	sprintf(out, "%s/.r.li/output/%s", G_home(), output);
+	res = open(out, O_WRONLY | O_CREAT | O_TRUNC, 0644);
     }
     i = 0;
 



More information about the grass-commit mailing list