Commit f403317e authored by Stefan Walter's avatar Stefan Walter

Fix compiler warnings for gcc 4.3.

	* daemon/seahorse-daemon.c:
	* daemon/seahorse-hkp-server.c:
	* libseahorse/seahorse-util.c:
	* libseahorse/seahorse-validity.c:
	* pgp/seahorse-gpg-options.c:
	* pgp/seahorse-gpgme-io.c:
	* pgp/seahorse-hkp-source.c:
	* pgp/seahorse-ldap-source.c:
	* pgp/seahorse-ssh-askpass.c: Fix compiler warnings
	for gcc 4.3. 
	

svn path=/trunk/; revision=2515
parent d1d4f18f
2008-09-14 Stef Walter <stef@memberwebs.com>
* daemon/seahorse-daemon.c:
* daemon/seahorse-hkp-server.c:
* libseahorse/seahorse-util.c:
* libseahorse/seahorse-validity.c:
* pgp/seahorse-gpg-options.c:
* pgp/seahorse-gpgme-io.c:
* pgp/seahorse-hkp-source.c:
* pgp/seahorse-ldap-source.c:
* pgp/seahorse-ssh-askpass.c: Fix compiler warnings
for gcc 4.3.
2008-09-14 Stef Walter <stef@memberwebs.com> 2008-09-14 Stef Walter <stef@memberwebs.com>
* src/seahorse-key-manager-store.c: Disconnect from 'sort-changed' * src/seahorse-key-manager-store.c: Disconnect from 'sort-changed'
......
...@@ -98,7 +98,9 @@ daemonize () ...@@ -98,7 +98,9 @@ daemonize ()
open ("/dev/null", O_WRONLY, 0666); open ("/dev/null", O_WRONLY, 0666);
open ("/dev/null", O_WRONLY, 0666); open ("/dev/null", O_WRONLY, 0666);
chdir ("/tmp"); if (chdir ("/tmp") < 0)
warn ("couldn't change to /tmp directory");
return; /* Child process returns */ return; /* Child process returns */
}; };
} }
......
...@@ -480,7 +480,7 @@ seahorse_hkp_server_start(GError **err) ...@@ -480,7 +480,7 @@ seahorse_hkp_server_start(GError **err)
soup_server = soup_server_new (SOUP_SERVER_PORT, port, NULL); soup_server = soup_server_new (SOUP_SERVER_PORT, port, NULL);
if (!soup_server) { if (!soup_server) {
g_set_error (err, HKP_SERVER_ERROR, errno, g_strdup (strerror (errno))); g_set_error (err, HKP_SERVER_ERROR, errno, "%s", g_strerror (errno));
return FALSE; return FALSE;
} }
......
...@@ -79,7 +79,7 @@ seahorse_util_show_error (GtkWidget *parent, const gchar *heading, const gchar * ...@@ -79,7 +79,7 @@ seahorse_util_show_error (GtkWidget *parent, const gchar *heading, const gchar *
error = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent), error = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),
GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE, text); GTK_BUTTONS_CLOSE, "%s", text);
g_free (text); g_free (text);
gtk_dialog_run (GTK_DIALOG (error)); gtk_dialog_run (GTK_DIALOG (error));
...@@ -686,7 +686,7 @@ seahorse_util_uris_package (const gchar* package, const char** uris) ...@@ -686,7 +686,7 @@ seahorse_util_uris_package (const gchar* package, const char** uris)
g_object_unref (fpackage); g_object_unref (fpackage);
if (out) { if (out) {
g_print (out); g_print ("%s", out);
g_free (out); g_free (out);
} }
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <string.h>
#include "seahorse-validity.h" #include "seahorse-validity.h"
const gchar* const gchar*
......
...@@ -52,14 +52,14 @@ create_file (const gchar *file, mode_t mode, GError **err) ...@@ -52,14 +52,14 @@ create_file (const gchar *file, mode_t mode, GError **err)
if ((fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, mode)) == -1) { if ((fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, mode)) == -1) {
g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
strerror (errno)); "%s", g_strerror (errno));
return FALSE; return FALSE;
} }
/* Write the header when we make a new file */ /* Write the header when we make a new file */
if (write (fd, GPG_CONF_HEADER, strlen (GPG_CONF_HEADER)) == -1) { if (write (fd, GPG_CONF_HEADER, strlen (GPG_CONF_HEADER)) == -1) {
g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno), g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
strerror (errno)); "%s", strerror (errno));
} }
close (fd); close (fd);
...@@ -92,7 +92,7 @@ find_config_file (gboolean read, GError **err) ...@@ -92,7 +92,7 @@ find_config_file (gboolean read, GError **err)
if (mkdir (gpg_homedir, 0700) == -1) { if (mkdir (gpg_homedir, 0700) == -1) {
g_set_error (err, G_IO_CHANNEL_ERROR, g_set_error (err, G_IO_CHANNEL_ERROR,
g_io_channel_error_from_errno (errno), g_io_channel_error_from_errno (errno),
strerror (errno)); "%s", strerror (errno));
return NULL; return NULL;
} }
} }
......
...@@ -41,7 +41,7 @@ handle_gio_error (GError *err) ...@@ -41,7 +41,7 @@ handle_gio_error (GError *err)
g_return_val_if_fail (err, -1); g_return_val_if_fail (err, -1);
if (err->message) if (err->message)
g_message (err->message); g_message ("%s", err->message);
switch (err->code) { switch (err->code) {
case G_IO_ERROR_FAILED: case G_IO_ERROR_FAILED:
......
...@@ -315,7 +315,7 @@ fail_hkp_operation (SeahorseHKPOperation *hop, SoupMessage *msg, const gchar *te ...@@ -315,7 +315,7 @@ fail_hkp_operation (SeahorseHKPOperation *hop, SoupMessage *msg, const gchar *te
g_object_get (hop->hsrc, "key-server", &server, NULL); g_object_get (hop->hsrc, "key-server", &server, NULL);
if (text) { if (text) {
error = g_error_new (HKP_ERROR_DOMAIN, msg ? msg->status_code : 0, text); error = g_error_new (HKP_ERROR_DOMAIN, msg ? msg->status_code : 0, "%s", text);
} else if (msg) { } else if (msg) {
/* Make the body lower case, and no tags */ /* Make the body lower case, and no tags */
......
...@@ -481,7 +481,7 @@ result_callback (SeahorseLDAPOperation *lop) ...@@ -481,7 +481,7 @@ result_callback (SeahorseLDAPOperation *lop)
switch (r) { switch (r) {
case -1: /* Strange system error */ case -1: /* Strange system error */
seahorse_operation_mark_done (SEAHORSE_OPERATION (lop), FALSE, seahorse_operation_mark_done (SEAHORSE_OPERATION (lop), FALSE,
g_error_new (LDAP_ERROR_DOMAIN, errno, strerror(errno))); g_error_new (LDAP_ERROR_DOMAIN, errno, "%s", g_strerror (errno)));
return FALSE; return FALSE;
case 0: /* Timeout exceeded */ case 0: /* Timeout exceeded */
......
...@@ -37,7 +37,7 @@ static gchar* ...@@ -37,7 +37,7 @@ static gchar*
askpass_command (const gchar *cmd, const gchar *arg) askpass_command (const gchar *cmd, const gchar *arg)
{ {
const gchar* env; const gchar* env;
gchar *t; gchar *t, *ret;
int fd; int fd;
/* Try an open the connection with seahorse */ /* Try an open the connection with seahorse */
...@@ -68,7 +68,7 @@ askpass_command (const gchar *cmd, const gchar *arg) ...@@ -68,7 +68,7 @@ askpass_command (const gchar *cmd, const gchar *arg)
/* Read the setting */ /* Read the setting */
t = g_new0 (gchar, 512); t = g_new0 (gchar, 512);
fgets (t, 512, seahorse_link); ret = fgets (t, 512, seahorse_link);
/* Make sure it worked */ /* Make sure it worked */
if (ferror (seahorse_link)) { if (ferror (seahorse_link)) {
...@@ -107,7 +107,8 @@ int main (int argc, char* argv[]) ...@@ -107,7 +107,8 @@ int main (int argc, char* argv[])
if (pass == NULL) if (pass == NULL)
return 1; return 1;
write (1, pass, strlen (pass)); if (write (1, pass, strlen (pass)) != strlen (pass))
g_warning ("couldn't write out password properly");
for (p = pass; *p; p++) for (p = pass; *p; p++)
*p = 0; *p = 0;
g_free (pass); g_free (pass);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment