~ubuntu-branches/ubuntu/karmic/exo/karmic

« back to all changes in this revision

Viewing changes to exo/exo-mount-point.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2009-08-21 14:28:56 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090821142856-xp7o7hl7x9xa2213
Tags: 0.3.102-1ubuntu1
* Merge from Debian unstable, remaining Ubuntu changes:
  - debian/rules:
    + Removed mangling of helpers.rc
    + Add --enable-gtk-doc switch to configure
  - debian/control:
    + Add build-dep on gtk-doc-tools
    + Update Vcs-* fields
  - debian/patches:
    + 04_update_helpers.patch: patched libexo's firefox helper desktop file
      to use firefox-3.0 icon instead of firefox icon
    + xubuntu-default-mount-options.patch: change default mount options for
      vfat, iso9660, ntfs
    + series: refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: exo-mount-point.c 25931 2007-07-20 20:18:08Z benny $ */
 
1
/* $Id$ */
2
2
/*-
3
3
 * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org>.
4
4
 *
253
253
 
254
254
  /* close the file handle */
255
255
  fclose (fp);
256
 
#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
257
 
  struct statfs *mntbuf = NULL;
258
 
  glong          bufsize = 0;
259
 
  gint           mntsize;
260
 
  gint           n;
261
 
 
262
 
  /* determine the number of active mount points */
263
 
  mntsize = getfsstat (NULL, 0, MNT_NOWAIT);
264
 
  if (G_LIKELY (mntsize > 0))
265
 
    {
266
 
      /* allocate a new buffer */
267
 
      bufsize = (mntsize + 4) * sizeof (*mntbuf);
268
 
      mntbuf = (struct statfs *) malloc (bufsize);
269
 
 
270
 
      /* determine the mount point for the device file */
271
 
      mntsize = getfsstat (mntbuf, bufsize, MNT_NOWAIT);
272
 
      for (n = 0; n < mntsize; ++n)
273
 
        {
274
 
          /* check if we have a match here */
275
 
          exo_mount_point_add_if_matches (mask, device, folder, fstype, mntbuf[n].f_mntfromname, mntbuf[n].f_mntonname,
276
 
                                          mntbuf[n].f_fstypename, ((mntbuf[n].f_flags & MNT_RDONLY) != 0), &mount_points);
277
 
        }
278
 
 
279
 
      /* release the buffer */
280
 
      free (mntbuf);
281
 
    }
282
256
#elif defined(HAVE_GETVFSSTAT) /* Newer NetBSD */
283
257
  struct statvfs *mntbuf = NULL;
284
258
  glong           bufsize = 0;
309
283
      /* release the buffer */
310
284
      free (mntbuf);
311
285
    }
 
286
#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
 
287
  struct statfs *mntbuf = NULL;
 
288
  glong          bufsize = 0;
 
289
  gint           mntsize;
 
290
  gint           n;
 
291
 
 
292
  /* determine the number of active mount points */
 
293
  mntsize = getfsstat (NULL, 0, MNT_NOWAIT);
 
294
  if (G_LIKELY (mntsize > 0))
 
295
    {
 
296
      /* allocate a new buffer */
 
297
      bufsize = (mntsize + 4) * sizeof (*mntbuf);
 
298
      mntbuf = (struct statfs *) malloc (bufsize);
 
299
 
 
300
      /* determine the mount point for the device file */
 
301
      mntsize = getfsstat (mntbuf, bufsize, MNT_NOWAIT);
 
302
      for (n = 0; n < mntsize; ++n)
 
303
        {
 
304
          /* check if we have a match here */
 
305
          exo_mount_point_add_if_matches (mask, device, folder, fstype, mntbuf[n].f_mntfromname, mntbuf[n].f_mntonname,
 
306
                                          mntbuf[n].f_fstypename, ((mntbuf[n].f_flags & MNT_RDONLY) != 0), &mount_points);
 
307
        }
 
308
 
 
309
      /* release the buffer */
 
310
      free (mntbuf);
 
311
    }
312
312
#else
313
313
#error "Add support for your operating system here."
314
314
#endif