~ubuntu-branches/ubuntu/natty/gnome-keyring/natty

« back to all changes in this revision

Viewing changes to daemon/dbus/gkd-secret-error.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-02-16 19:00:06 UTC
  • mfrom: (1.1.58 upstream)
  • Revision ID: james.westby@ubuntu.com-20100216190006-cqpnic4zxlkmmi0o
Tags: 2.29.90git20100218-0ubuntu1
Updated to a git snapshot version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * gnome-keyring
 
3
 *
 
4
 * Copyright (C) 2008 Stefan Walter
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU Lesser General Public License as
 
8
 * published by the Free Software Foundation; either version 2.1 of
 
9
 * the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful, but
 
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
19
 * 02111-1307, USA.
 
20
 */
 
21
 
 
22
#include "config.h"
 
23
 
 
24
#include <glib.h>
 
25
 
 
26
#include "gkd-secret-error.h"
 
27
 
 
28
DBusMessage*
 
29
gkd_secret_error_no_such_object (DBusMessage *message)
 
30
{
 
31
        g_return_val_if_fail (message, NULL);
 
32
        return dbus_message_new_error_printf (message, SECRET_ERROR_NO_SUCH_OBJECT,
 
33
                                              "The '%s' object does not exist", dbus_message_get_path (message));
 
34
}
 
35
 
 
36
DBusMessage*
 
37
gkd_secret_error_to_reply (DBusMessage *message, DBusError *derr)
 
38
{
 
39
        DBusMessage *reply;
 
40
 
 
41
        g_return_val_if_fail (message, NULL);
 
42
        g_return_val_if_fail (derr, NULL);
 
43
        g_return_val_if_fail (dbus_error_is_set (derr), NULL);
 
44
 
 
45
        reply = dbus_message_new_error (message, derr->name, derr->message);
 
46
        dbus_error_free (derr);
 
47
        return reply;
 
48
}