From 39df21227d00fa4c2d37b413a5432c6a36b61d98 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 16 Sep 2001 00:30:45 +0000 Subject: add support for a mini icon in the titlebar (update_icon): re-enable 2001-09-15 Havoc Pennington * src/window.c: add support for a mini icon in the titlebar (update_icon): re-enable support for _NET_WM_ICON * src/session.c (save_state): add an ferror check when writing session file --- src/session.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/session.c') diff --git a/src/session.c b/src/session.c index 00290e69..de65a513 100644 --- a/src/session.c +++ b/src/session.c @@ -97,8 +97,8 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening, */ GIOChannel *channel; - fcntl (IceConnectionNumber(connection),F_SETFD, - fcntl(IceConnectionNumber(connection),F_GETFD,0) | FD_CLOEXEC); + fcntl (IceConnectionNumber (connection), F_SETFD, + fcntl (IceConnectionNumber (connection), F_GETFD, 0) | FD_CLOEXEC); channel = g_io_channel_unix_new (IceConnectionNumber (connection)); @@ -119,15 +119,15 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening, } } -static IceIOErrorHandler gnome_ice_installed_handler; +static IceIOErrorHandler ice_installed_handler; /* We call any handler installed before (or after) gnome_ice_init but avoid calling the default libICE handler which does an exit() */ static void ice_io_error_handler (IceConn connection) { - if (gnome_ice_installed_handler) - (*gnome_ice_installed_handler) (connection); + if (ice_installed_handler) + (*ice_installed_handler) (connection); } static void @@ -139,11 +139,11 @@ ice_init (void) { IceIOErrorHandler default_handler; - gnome_ice_installed_handler = IceSetIOErrorHandler (NULL); + ice_installed_handler = IceSetIOErrorHandler (NULL); default_handler = IceSetIOErrorHandler (ice_io_error_handler); - if (gnome_ice_installed_handler == default_handler) - gnome_ice_installed_handler = NULL; + if (ice_installed_handler == default_handler) + ice_installed_handler = NULL; IceAddConnectionWatch (new_ice_connection, NULL); @@ -879,11 +879,17 @@ save_state (void) out: if (outfile) { - if (fclose (outfile) != 0) + /* FIXME need a dialog for this */ + if (ferror (outfile)) { meta_warning (_("Error writing session file '%s': %s\n"), session_file, g_strerror (errno)); } + if (fclose (outfile)) + { + meta_warning (_("Error closing session file '%s': %s\n"), + session_file, g_strerror (errno)); + } } g_free (metacity_dir); -- cgit v1.2.1