~ubuntu-branches/ubuntu/intrepid/parted/intrepid

« back to all changes in this revision

Viewing changes to libparted/device.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-24 14:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080624143105-rd7yw67a9qnvh51i
Tags: 1.8.8.git.2008.03.24-7ubuntu1
* Resynchronise with Debian (LP: #237568). Remaining changes:
  - swap-uuid.dpatch: Create UUIDs on new swap partitions.
  - gptsync.dpatch: On Intel Mac systems, write a synced MBR rather than a
    protective MBR.
  - Add -fno-stack-protector on sparc.
  - sparc-new-label.dpatch: Fix sparc disk label generation. This is
    required for LDOM and parallel installations with Solaris 10.
  - loop-partitions.dpatch: Loop devices can only have one partition, so
    don't generate device names such as "/dev/loop0p1".
  - unpartitioned-disks.dpatch: Don't try to call BLKPG ioctls on
    unpartitionable disks (only implemented for loop devices at the
    moment), as they will always fail.
  - When building with gcc-4.3, add -Wno-array-bounds to CFLAGS.
  - Cell partition tables are misdetected as pc98, so disable pc98 support
    on powerpc.
  - array-bounds.dpatch: Backport patch from git to allow building with
    gcc-4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    libparted - a library for manipulating disk partitions
3
 
    Copyright (C) 1999 - 2001, 2005 Free Software Foundation, Inc.
 
3
    Copyright (C) 1999 - 2001, 2005, 2007 Free Software Foundation, Inc.
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
6
    it under the terms of the GNU General Public License as published by
7
 
    the Free Software Foundation; either version 2 of the License, or
 
7
    the Free Software Foundation; either version 3 of the License, or
8
8
    (at your option) any later version.
9
9
 
10
10
    This program is distributed in the hope that it will be useful,
13
13
    GNU General Public License for more details.
14
14
 
15
15
    You should have received a copy of the GNU General Public License
16
 
    along with this program; if not, write to the Free Software
17
 
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 
16
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
17
*/
19
18
 
20
19
/** \file device.c */
36
35
 * @{
37
36
 */
38
37
 
39
 
#define _GNU_SOURCE 1
40
 
 
41
 
#include "config.h"
 
38
#include <config.h>
42
39
 
43
40
#include <parted/parted.h>
44
41
#include <parted/debug.h>
45
42
 
46
43
#include <limits.h>
47
 
#include <string.h>
48
 
#include <stdlib.h>
49
44
#include <unistd.h>
50
45
#include <errno.h>
51
46
 
70
65
 
71
66
        /* Just in case realpath does not NULL terminate the string
72
67
         * or it just fits in SIZE without a NULL terminator.  */
73
 
        buf = calloc (size + 1, 1);
 
68
        buf = calloc (size + 1, sizeof(char));
74
69
        if (! buf) {
75
70
                errno = ENOMEM;
76
71
                return NULL;
194
189
        ped_free (normal_path);
195
190
        if (!walk)
196
191
                return NULL;
 
192
 
197
193
        _device_register (walk);
198
194
        return walk;
199
195
}
216
212
        ped_architecture->dev_ops->destroy (dev);
217
213
}
218
214
 
 
215
void
 
216
ped_device_cache_remove(PedDevice *dev)
 
217
{
 
218
        _device_unregister (dev);
 
219
}
 
220
 
219
221
int
220
222
ped_device_is_busy (PedDevice* dev)
221
223
{