[GRASS-SVN] r53140 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 9 04:15:37 PDT 2012


Author: mmetz
Date: 2012-09-09 04:15:37 -0700 (Sun, 09 Sep 2012)
New Revision: 53140

Modified:
   grass/trunk/lib/init/lock.c
Log:
init lib: don't guess error, get error description from system

Modified: grass/trunk/lib/init/lock.c
===================================================================
--- grass/trunk/lib/init/lock.c	2012-09-09 11:01:24 UTC (rev 53139)
+++ grass/trunk/lib/init/lock.c	2012-09-09 11:15:37 UTC (rev 53140)
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -57,8 +58,8 @@
 	G_fatal_error("%s: ", argv[0]);
     }
     if (write(lock, &lockpid, sizeof lockpid) != sizeof lockpid)
-	G_fatal_error(_("Unable to write lockfile %s (disk full? Permissions?)"),
-		      file);
+	G_fatal_error(_("Unable to write lockfile %s (%s)"),
+		      file, strerror(errno));
     close(lock);
     exit(0);
 #endif



More information about the grass-commit mailing list