~ubuntu-branches/ubuntu/quantal/gconf/quantal

« back to all changes in this revision

Viewing changes to gconf/gconf-sanity-check.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-08-19 13:42:30 UTC
  • mto: (7.2.1 sid) (1.2.1) (76.1.1 oneiric-proposed)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080819134230-65832cyama90mbk6
Tags: upstream-2.23.2
ImportĀ upstreamĀ versionĀ 2.23.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Boston, MA 02111-1307, USA.
18
18
 */
19
19
 
 
20
#include "config.h"
20
21
#include "gconf.h"
21
22
#include "gconf-internals.h"
22
23
#include "gconf-sources.h"
119
120
      GError *err;
120
121
 
121
122
      err = NULL;
122
 
      fd = g_file_open_tmp ("gconf-test-locking-file-XXXXXX",
123
 
                            &testfile,
124
 
                            &err);
 
123
      if (g_getenv ("GCONF_TMPDIR")) {
 
124
        testfile = g_build_filename(g_getenv ("GCONF_TMPDIR"), "gconf-test-locking-file-XXXXXX", NULL);
 
125
        fd = g_mkstemp (testfile);
 
126
        if (fd == -1)
 
127
            {
 
128
              g_set_error (&err,
 
129
                           G_FILE_ERROR,
 
130
                           g_file_error_from_errno (errno),
 
131
                           "Failed to create file '%s': %s",
 
132
                           testfile, g_strerror (errno));
 
133
            }
 
134
        }
 
135
      else {
 
136
              fd = g_file_open_tmp ("gconf-test-locking-file-XXXXXX",
 
137
                                    &testfile,
 
138
                                    &err);
 
139
      }
125
140
 
126
141
      if (err != NULL)
127
142
        {
381
396
 
382
397
      g_slist_free (addresses);
383
398
      
384
 
      gconf_daemon_blow_away_locks ();
385
 
 
386
399
      return TRUE;
387
400
    }
388
401