summaryrefslogtreecommitdiff
path: root/gtk/gtkmountoperation-x11.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2009-08-20 15:32:22 +0200
committerChristian Persch <chpe@gnome.org>2009-08-24 15:30:00 +0200
commite8dcf330cca3e97ee8ca1a5b81c6f475df4eeed1 (patch)
tree75876b02db77fc924d6ea81562e779b92be1e64c /gtk/gtkmountoperation-x11.c
parenta79f929dd6c89fceeaf0d9039e5a10cad9d87d2f (diff)
downloadgtk+-e8dcf330cca3e97ee8ca1a5b81c6f475df4eeed1.tar.gz
Preserve errno, and always use g_strerror()
Bug #592461.
Diffstat (limited to 'gtk/gtkmountoperation-x11.c')
-rw-r--r--gtk/gtkmountoperation-x11.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkmountoperation-x11.c b/gtk/gtkmountoperation-x11.c
index 2a2c4a0046..1bfb50308b 100644
--- a/gtk/gtkmountoperation-x11.c
+++ b/gtk/gtkmountoperation-x11.c
@@ -952,6 +952,8 @@ _gtk_mount_operation_kill_process (GPid pid,
if (kill ((pid_t) pid, SIGTERM) != 0)
{
+ int errsv = errno;
+
/* TODO: On EPERM, we could use a setuid helper using polkit (very easy to implement
* via pkexec(1)) to allow the user to e.g. authenticate to gain the authorization
* to kill the process. But that's not how things currently work.
@@ -960,10 +962,10 @@ _gtk_mount_operation_kill_process (GPid pid,
ret = FALSE;
g_set_error (error,
G_IO_ERROR,
- g_io_error_from_errno (errno),
+ g_io_error_from_errno (errsv),
_("Cannot end process with pid %d: %s"),
pid,
- strerror (errno));
+ g_strerror (errsv));
}
return ret;