[Gpa-commits] r819 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 15 14:46:05 CET 2008


Author: marcus
Date: 2008-02-15 14:46:04 +0100 (Fri, 15 Feb 2008)
New Revision: 819

Modified:
   trunk/src/ChangeLog
   trunk/src/get-path.c
   trunk/src/gpa.c
   trunk/src/gpafiledecryptop.c
   trunk/src/gpafileencryptop.c
   trunk/src/gpafilesignop.c
   trunk/src/gpgmetools.c
   trunk/src/keylist.c
   trunk/src/keyserver.c
   trunk/src/keyserver.h
   trunk/src/options.c
Log:
2008-02-15  Marcus Brinkmann  <marcus at g10code.de>

	* options.c: Include <glib/gstdio.h>.
	(gpa_options_save_settings): Use g_fopen instead of open.
	(gpa_options_read_settings): Likewise.
	* keyserver.c: Include <glib/gstdio.h>.
	(read_list): Use g_fopen instead of fopen.  Change argument type
	to gchar.
	(keyserver_read_list): Change argument type to gchar.
	* keyserver.h: Likewise in prototype.
	* gpgmetools.c: Include <glib/gstdio.h>.
	(gpa_fopen): Use g_fopen instead of fopen.
	(gpa_backup_key): Likewise.
	(gpa_open_output): Use g_open instead of open.
	(gpa_open_input): Likewise.
	* gpafileencryptop.c: Include <glib/gstdio.h>.
	(gpa_file_encrypt_operation_done_cb): Use g_unlink instead of unlink.
	* gpafiledecryptop.c: Include <glib/gstdio.h>.
	(gpa_file_decrypt_operation_done_cb): Use g_unlink instead of unlink.
	* gpafilesignop.c: Include <glib/gstdio.h>.
	(gpa_file_sign_operation_done_cb): Use g_unlink instead of unlink.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/ChangeLog	2008-02-15 13:46:04 UTC (rev 819)
@@ -1,5 +1,25 @@
 2008-02-15  Marcus Brinkmann  <marcus at g10code.de>
 
+	* options.c: Include <glib/gstdio.h>.
+	(gpa_options_save_settings): Use g_fopen instead of open.
+	(gpa_options_read_settings): Likewise.
+	* keyserver.c: Include <glib/gstdio.h>.
+	(read_list): Use g_fopen instead of fopen.  Change argument type
+	to gchar.
+	(keyserver_read_list): Change argument type to gchar.
+	* keyserver.h: Likewise in prototype.
+	* gpgmetools.c: Include <glib/gstdio.h>.
+	(gpa_fopen): Use g_fopen instead of fopen.
+	(gpa_backup_key): Likewise.
+	(gpa_open_output): Use g_open instead of open.
+	(gpa_open_input): Likewise.
+	* gpafileencryptop.c: Include <glib/gstdio.h>.
+	(gpa_file_encrypt_operation_done_cb): Use g_unlink instead of unlink.
+	* gpafiledecryptop.c: Include <glib/gstdio.h>.
+	(gpa_file_decrypt_operation_done_cb): Use g_unlink instead of unlink.
+	* gpafilesignop.c: Include <glib/gstdio.h>.
+	(gpa_file_sign_operation_done_cb): Use g_unlink instead of unlink.
+
 	* keygendlg.c (struct _GPAKeyGenDialog): New member entryUserID.
 	(gpa_key_gen_run_dialog): Initialize it.
 	(response_cb): Complain if there is no user ID.

Modified: trunk/src/get-path.c
===================================================================
--- trunk/src/get-path.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/get-path.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -150,6 +150,7 @@
 {
   gchar *dir;
 
+  /* g_getenv returns string in filename encoding.  */
   dir = (gchar *) g_getenv ("GNUPGHOME");
   if (dir && dir[0])
     dir = g_strdup (dir);

Modified: trunk/src/gpa.c
===================================================================
--- trunk/src/gpa.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/gpa.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -338,7 +338,6 @@
   putenv ("OUTPUT_CHARSET=utf8");
 #endif
 
-
   /* Handle command line options.  */
 
   /* Start the keyring editor by default.  */

Modified: trunk/src/gpafiledecryptop.c
===================================================================
--- trunk/src/gpafiledecryptop.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/gpafiledecryptop.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -22,6 +22,7 @@
 #include <config.h>
 
 #include <glib.h>
+#include <glib/gstdio.h>
 
 #ifdef G_OS_UNIX
 #include <unistd.h>
@@ -310,7 +311,7 @@
 	{
 	  /* If an error happened, (or the user canceled) delete the
 	     created file and abort further decryptions.  */
-	  unlink (file_item->filename_out);
+	  g_unlink (file_item->filename_out);
 	  g_free (file_item->filename_out);
 	  file_item->filename_out = NULL;
 	}

Modified: trunk/src/gpafileencryptop.c
===================================================================
--- trunk/src/gpafileencryptop.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/gpafileencryptop.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -22,6 +22,7 @@
 #include <config.h>
 
 #include <glib.h>
+#include <glib/gstdio.h>
 
 #ifdef G_OS_UNIX
 #include <unistd.h>
@@ -415,7 +416,7 @@
 	{
 	  /* If an error happened, (or the user canceled) delete the
 	    created file and abort further encryptions.  */
-	  unlink (file_item->filename_out);
+	  g_unlink (file_item->filename_out);
 	  g_free (file_item->filename_out);
 	  file_item->filename_out = NULL;
 	}

Modified: trunk/src/gpafilesignop.c
===================================================================
--- trunk/src/gpafilesignop.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/gpafilesignop.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -22,6 +22,7 @@
 #include <config.h>
 
 #include <glib.h>
+#include <glib/gstdio.h>
 
 #ifdef G_OS_UNIX
 #include <unistd.h>
@@ -376,7 +377,7 @@
 	{
 	  /* If an error happened, (or the user canceled) delete the
 	     created file and abort further signions.  */
-	  unlink (op->sig_filename);
+	  g_unlink (op->sig_filename);
 	  g_free (op->sig_filename);
 	}
       g_signal_emit_by_name (GPA_OPERATION (op), "completed");

Modified: trunk/src/gpgmetools.c
===================================================================
--- trunk/src/gpgmetools.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/gpgmetools.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -41,6 +41,8 @@
 #include <windows.h>
 #endif
 
+#include <glib/gstdio.h>
+
 #ifndef O_BINARY
 #ifdef _O_BINARY
 #define O_BINARY	_O_BINARY
@@ -160,7 +162,7 @@
   
   if (!check_overwriting (filename, parent))
     return NULL;
-  target = fopen (filename, "w");
+  target = g_fopen (filename, "w");
   if (!target)
     {
       gchar *message;
@@ -182,7 +184,8 @@
     {
       gpg_error_t err;
 
-      target = open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
+      target = g_open (filename,
+		       O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
       if (target == -1)
 	{
 	  gchar *message;
@@ -208,7 +211,7 @@
   gpg_error_t err;
   int target = -1;
 
-  target = open (filename, O_RDONLY | O_BINARY);
+  target = g_open (filename, O_RDONLY | O_BINARY, 0);
   if (target == -1)
     {
       gchar *message;
@@ -429,7 +432,7 @@
   sec_argv[0] = (gchar*) path;
   /* Open the file */
   mask = umask (0077);
-  file = fopen (filename, "w");
+  file = g_fopen (filename, "w");
   umask (mask);
   if (!file)
     {

Modified: trunk/src/keylist.c
===================================================================
--- trunk/src/keylist.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/keylist.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -20,6 +20,8 @@
 
 #include <config.h>
 
+#include <glib/gstdio.h>
+
 #include "gpa.h"
 #include "keylist.h"
 #include "gpapastrings.h"

Modified: trunk/src/keyserver.c
===================================================================
--- trunk/src/keyserver.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/keyserver.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -88,7 +88,7 @@
 
 
 static int
-read_list (const char *fname)
+read_list (const gchar *fname)
 {
   FILE *fp;
   char line[256], *p;
@@ -99,7 +99,7 @@
   if (!fname)
     return -1;
 
-  fp = fopen (fname, "r");
+  fp = g_fopen (fname, "r");
   if (!fp)       
     {
 /*
@@ -159,7 +159,7 @@
  * Returns: 0 = okay.
  */
 int
-keyserver_read_list (const char *confname)
+keyserver_read_list (const gchar *confname)
 {
   int rc;
 

Modified: trunk/src/keyserver.h
===================================================================
--- trunk/src/keyserver.h	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/keyserver.h	2008-02-15 13:46:04 UTC (rev 819)
@@ -24,7 +24,7 @@
 #include <glib.h>
 
 
-int keyserver_read_list (const char *filename);
+int keyserver_read_list (const gchar *filename);
 GList *keyserver_get_as_glist (void);
 
 

Modified: trunk/src/options.c
===================================================================
--- trunk/src/options.c	2008-02-15 12:42:42 UTC (rev 818)
+++ trunk/src/options.c	2008-02-15 13:46:04 UTC (rev 819)
@@ -21,6 +21,8 @@
 #include <config.h>
 
 #include <glib.h>
+#include <glib/gstdio.h>
+
 #include "options.h"
 #include "gpa.h"
 #include "gtktools.h"
@@ -397,7 +399,7 @@
   FILE *options_file;
   
   g_assert(options->options_file != NULL);
-  options_file =  fopen (options->options_file, "w");
+  options_file = g_fopen (options->options_file, "w");
   if (!options_file)
     {
       g_warning("%s: %s", options->options_file, strerror (errno));
@@ -473,7 +475,7 @@
   FILE *options_file;
   
   g_assert(options->options_file != NULL);
-  options_file =  fopen (options->options_file, "r");
+  options_file = g_fopen (options->options_file, "r");
   if (!options_file)
     {
       /* If the config file just doesn't exist, it's not an error */



More information about the Gpa-commits mailing list