udisks_helper_delete_partition_LDADD = $(GLIB_LIBS) libpartutil.la
udisks_helper_create_partition_SOURCES = job-shared.h job-create-partition.c
-udisks_helper_create_partition_CPPFLAGS = $(AM_CPPFLAGS)
-udisks_helper_create_partition_LDADD = $(GLIB_LIBS) libpartutil.la
+udisks_helper_create_partition_CPPFLAGS = $(AM_CPPFLAGS) $(GUDEV_CFLAGS)
+udisks_helper_create_partition_LDADD = $(GLIB_LIBS) $(GUDEV_LIBS) libpartutil.la
udisks_helper_modify_partition_SOURCES = job-shared.h job-modify-partition.c
udisks_helper_modify_partition_CPPFLAGS = $(AM_CPPFLAGS)
fd = open (device, O_WRONLY);
if (fd < 0)
{
- g_printerr ("cannot open device: %m\n");
+ g_printerr ("cannot open %s: %m\n", device);
goto out;
}
{
if (ioctl (fd, BLKGETSIZE64, &size) != 0)
{
- g_printerr ("cannot determine size of device: %m\n");
+ g_printerr ("cannot determine size of %s: %m\n", device);
goto out;
}
}
if (lseek64 (fd, offset, SEEK_SET) == (off64_t) - 1)
{
- g_printerr ("cannot seek to %" G_GINT64_FORMAT ": %m", offset);
+ g_printerr ("cannot seek to %" G_GINT64_FORMAT " on %s: %m", offset, device);
goto out;
}
if (lseek64 (fd, offset + size - wipe_size, SEEK_SET) == (off64_t) - 1)
{
- g_printerr ("cannot seek to %" G_GINT64_FORMAT ": %m", offset + size - wipe_size);
+ g_printerr ("cannot seek to %" G_GINT64_FORMAT " on %s: %m", offset + size - wipe_size, device);
goto out;
}
out:
if (fd >= 0)
- close (fd);
+ {
+ if (fsync (fd) != 0)
+ {
+ g_printerr ("Error calling fsync(2) on %s: %m\n", device);
+ ret = FALSE;
+ }
+ close (fd);
+ }
return ret;
}