brasero r1480 - in trunk: . src src/plugins/checksum src/plugins/libburnia



Author: philippr
Date: Thu Nov  6 13:59:35 2008
New Revision: 1480
URL: http://svn.gnome.org/viewvc/brasero?rev=1480&view=rev

Log:
	Modify previous patch that uses g_set_error_literal which is only 
	available in glib 2.18 and brasero 0.8.x targets 2.16

	* src/brasero-sum-dialog.c (brasero_sum_dialog_get_file_checksum):
	* src/burn-job.c (brasero_job_check_output_volume_space),
	(brasero_job_set_output_file), (brasero_job_set_nonblocking_fd):
	* src/burn-mkisofs-base.c (_write_line),
	(brasero_mkisofs_base_process_video_graft),
	(brasero_mkisofs_base_write_to_files):
	* src/burn-volume-source.c (brasero_volume_source_seek_fd),
	(brasero_volume_source_read_fd),
	(brasero_volume_source_readcd_device_handle),
	(brasero_volume_source_read10_device_handle),
	(brasero_volume_source_open_file), (brasero_volume_source_open_fd):
	* src/plugins/checksum/burn-checksum-files.c
	(brasero_checksum_file_process_former_line),
	(brasero_checksum_files_get_line_num),
	(brasero_checksum_files_check_files):
	* src/plugins/libburnia/burn-libburn.c
	(brasero_libburn_add_file_track):
	* src/scsi-error.c (brasero_scsi_set_error):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-sum-dialog.c
   trunk/src/burn-job.c
   trunk/src/burn-mkisofs-base.c
   trunk/src/burn-volume-source.c
   trunk/src/plugins/checksum/burn-checksum-files.c
   trunk/src/plugins/libburnia/burn-libburn.c
   trunk/src/scsi-error.c

Modified: trunk/src/brasero-sum-dialog.c
==============================================================================
--- trunk/src/brasero-sum-dialog.c	(original)
+++ trunk/src/brasero-sum-dialog.c	Thu Nov  6 13:59:35 2008
@@ -403,10 +403,11 @@
 
 		g_free (src);
 
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
@@ -420,10 +421,11 @@
 	g_free (src);
 
 	if (ferror (file)) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 
 		fclose (file);
 		return BRASERO_BURN_ERR;

Modified: trunk/src/burn-job.c
==============================================================================
--- trunk/src/burn-job.c	(original)
+++ trunk/src/burn-job.c	Thu Nov  6 13:59:35 2008
@@ -495,10 +495,11 @@
 	/* Last but not least, use getrlimit () to check that we are allowed to
 	 * write a file of such length and that quotas won't get in our way */
 	if (getrlimit (RLIMIT_FSIZE, &limit)) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_DISK_SPACE,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_DISK_SPACE,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
@@ -518,10 +519,10 @@
 error:
 
 	if (error && *error == NULL)
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     _("the size of the volume can't be checked (Unknown error)"));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     _("the size of the volume can't be checked (Unknown error)"));
 	g_object_unref (file);
 	return BRASERO_BURN_ERR;
 }
@@ -558,10 +559,10 @@
 			/* check paths are set */
 			if (!image
 			|| (priv->type.subtype.img_format != BRASERO_IMAGE_FORMAT_BIN && !toc)) {
-				g_set_error_literal (error,
-                                                     BRASERO_BURN_ERROR,
-                                                     BRASERO_BURN_ERROR_GENERAL,
-                                                     _("no path"));
+				g_set_error (error,
+					     BRASERO_BURN_ERROR,
+					     BRASERO_BURN_ERROR_GENERAL,
+					     _("no path"));
 				return BRASERO_BURN_ERR;
 			}
 
@@ -1176,18 +1177,18 @@
 		 * automatically but still offer that possibility. */
 		flags |= O_NONBLOCK;
 		if (fcntl (fd, F_SETFL, flags) == -1) {
-			g_set_error_literal (error,
-                                             BRASERO_BURN_ERROR,
-                                             BRASERO_BURN_ERROR_GENERAL,
-                                             _("couldn't set non blocking mode"));
+			g_set_error (error,
+				     BRASERO_BURN_ERROR,
+				     BRASERO_BURN_ERROR_GENERAL,
+				     _("couldn't set non blocking mode"));
 			return BRASERO_BURN_ERR;
 		}
 	}
 	else {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     _("couldn't get pipe flags"));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     _("couldn't get pipe flags"));
 		return BRASERO_BURN_ERR;
 	}
 

Modified: trunk/src/burn-mkisofs-base.c
==============================================================================
--- trunk/src/burn-mkisofs-base.c	(original)
+++ trunk/src/burn-mkisofs-base.c	Thu Nov  6 13:59:35 2008
@@ -91,10 +91,11 @@
 
 	if (lseek (fd, 0, SEEK_CUR)
 	&&  write (fd, "\n", 1) != 1) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
@@ -102,10 +103,11 @@
 	w_len = write (fd, filepath, len);
 
 	if (w_len != len) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
@@ -397,10 +399,11 @@
 	g_free (link_path);
 
 	if (res) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
@@ -493,20 +496,22 @@
 
 	base.grafts_fd = open (grafts_path, O_WRONLY|O_TRUNC|O_EXCL);
 	if (base.grafts_fd == -1) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
 	base.excluded_fd = open (excluded_path, O_WRONLY|O_TRUNC|O_EXCL);
 	if (base.excluded_fd == -1) {
 		close (base.excluded_fd);
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 

Modified: trunk/src/burn-volume-source.c
==============================================================================
--- trunk/src/burn-volume-source.c	(original)
+++ trunk/src/burn-volume-source.c	Thu Nov  6 13:59:35 2008
@@ -70,10 +70,11 @@
 				  block,
 				  (guint64) (block * ISO9660_BLOCK_SIZE),
 				  strerror (errno));
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     strerror (errno));
 		return -1;
 	}
 
@@ -93,10 +94,11 @@
 	bytes_read = fread (buffer, 1, ISO9660_BLOCK_SIZE * blocks, src->data);
 	if (bytes_read != ISO9660_BLOCK_SIZE * blocks) {
 		BRASERO_BURN_LOG ("fread () failed (%s)", strerror (errno));
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     strerror (errno));
 		return FALSE;
 	}
 
@@ -161,10 +163,11 @@
 		}
 	}
 
-	g_set_error_literal (error,
-                             BRASERO_BURN_ERROR,
-                             BRASERO_BURN_ERROR_GENERAL,
-                             brasero_scsi_strerror (code));
+	g_set_error (error,
+		     BRASERO_BURN_ERROR,
+		     BRASERO_BURN_ERROR_GENERAL,
+		     "%s",
+		     brasero_scsi_strerror (code));
 
 	return FALSE;
 }
@@ -193,10 +196,11 @@
 	BRASERO_BURN_LOG ("READ10 failed %s at %i",
 			  brasero_scsi_strerror (code),
 			  src->position);
-	g_set_error_literal (error,
-                             BRASERO_BURN_ERROR,
-                             BRASERO_BURN_ERROR_GENERAL,
-                             brasero_scsi_strerror (code));
+	g_set_error (error,
+		     BRASERO_BURN_ERROR,
+		     BRASERO_BURN_ERROR_GENERAL,
+		     "%s",
+		     brasero_scsi_strerror (code));
 
 	return FALSE;
 }
@@ -224,10 +228,11 @@
 	file = fopen (path, "r");
 	if (!file) {
 		BRASERO_BURN_LOG ("open () failed (%s)", strerror (errno));
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     strerror (errno));
 		return FALSE;
 	}
 
@@ -250,10 +255,11 @@
 	dup_fd = dup (fd);
 	if (dup_fd == -1) {
 		BRASERO_BURN_LOG ("dup () failed (%s)", strerror (errno));
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     strerror (errno));
 		return FALSE;
 	}
 
@@ -262,10 +268,11 @@
 		close (dup_fd);
 
 		BRASERO_BURN_LOG ("fdopen () failed (%s)", strerror (errno));
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     strerror (errno));
 		return FALSE;
 	}
 

Modified: trunk/src/plugins/checksum/burn-checksum-files.c
==============================================================================
--- trunk/src/plugins/checksum/burn-checksum-files.c	(original)
+++ trunk/src/plugins/checksum/burn-checksum-files.c	Thu Nov  6 13:59:35 2008
@@ -331,18 +331,20 @@
 	/* write the whole line in the new file */
 	written_bytes = fwrite (line, 1, strlen (line), priv->file);
 	if (written_bytes != strlen (line)) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
 	if (!fwrite ("\n", 1, 1, priv->file)) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
@@ -659,10 +661,11 @@
 	}
 
 	if (!feof (file)) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return -1;
 	}
 
@@ -711,20 +714,22 @@
 	g_free (root);
 	g_free (path);
 	if (!file) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 
 	/* we need to get the number of files at this time and rewind */
 	file_nb = brasero_checksum_files_get_line_num (self, file, error);
 	if (file_nb < 1) {
-		g_set_error_literal (error,
-                                     BRASERO_BURN_ERROR,
-                                     BRASERO_BURN_ERROR_GENERAL,
-                                     g_strerror (errno));
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     "%s",
+			     g_strerror (errno));
 		fclose (file);
 		return BRASERO_BURN_ERR;
 	}
@@ -765,10 +770,11 @@
 		/* first read the checksum string */
 		if (fread (checksum_file, 1, checksum_len, file) != checksum_len) {
 			if (!feof (file))
-				g_set_error_literal (error,
-                                                     BRASERO_BURN_ERROR,
-                                                     BRASERO_BURN_ERROR_GENERAL,
-                                                     g_strerror (errno));
+				g_set_error (error,
+					     BRASERO_BURN_ERROR,
+					     BRASERO_BURN_ERROR_GENERAL,
+					     "%s",
+					     g_strerror (errno));
 			break;
 		}
 		checksum_file [checksum_len] = '\0';
@@ -787,10 +793,11 @@
 				if (errno == EAGAIN || errno == EINTR)
 					continue;
 
-				g_set_error_literal (error,
-                                                     BRASERO_BURN_ERROR,
-                                                     BRASERO_BURN_ERROR_GENERAL,
-                                                     g_strerror (errno));
+				g_set_error (error,
+					     BRASERO_BURN_ERROR,
+					     BRASERO_BURN_ERROR_GENERAL,
+					     "%s",
+					     g_strerror (errno));
 				goto end;
 			}
 
@@ -811,10 +818,11 @@
 				if (errno == EAGAIN || errno == EINTR)
 					continue;
 
-				g_set_error_literal (error,
-                                                     BRASERO_BURN_ERROR,
-                                                     BRASERO_BURN_ERROR_GENERAL,
-                                                     g_strerror (errno));
+				g_set_error (error,
+					     BRASERO_BURN_ERROR,
+					     BRASERO_BURN_ERROR_GENERAL,
+					     "%s",
+					     g_strerror (errno));
 				goto end;
 			}
 
@@ -888,10 +896,10 @@
 			       BRASERO_TRACK_MEDIUM_WRONG_CHECKSUM_TAG,
 			       value);
 
-	g_set_error_literal (error,
-                             BRASERO_BURN_ERROR,
-                             BRASERO_BURN_ERROR_BAD_CHECKSUM,
-                             _("some files may be corrupted on the disc"));
+	g_set_error (error,
+		     BRASERO_BURN_ERROR,
+		     BRASERO_BURN_ERROR_BAD_CHECKSUM,
+		     _("some files may be corrupted on the disc"));
 
 	return BRASERO_BURN_ERR;
 }

Modified: trunk/src/plugins/libburnia/burn-libburn.c
==============================================================================
--- trunk/src/plugins/libburnia/burn-libburn.c	(original)
+++ trunk/src/plugins/libburnia/burn-libburn.c	Thu Nov  6 13:59:35 2008
@@ -279,7 +279,8 @@
 		g_set_error (error,
 			     BRASERO_BURN_ERROR,
 			     BRASERO_BURN_ERROR_GENERAL,
-			     strerror (errno));
+			     "%s",
+			     g_strerror (errno));
 		return BRASERO_BURN_ERR;
 	}
 

Modified: trunk/src/scsi-error.c
==============================================================================
--- trunk/src/scsi-error.c	(original)
+++ trunk/src/scsi-error.c	Thu Nov  6 13:59:35 2008
@@ -59,11 +59,9 @@
 void
 brasero_scsi_set_error (GError **error, BraseroScsiErrCode code)
 {
-	if (!error)
-		return;
-
-	g_set_error_literal (error,
-                             BRASERO_BURN_ERROR,
-                             BRASERO_BURN_ERROR_GENERAL,
-                             brasero_scsi_strerror (code));
+	g_set_error (error,
+		     BRASERO_BURN_ERROR,
+		     BRASERO_BURN_ERROR_GENERAL,
+		     "%s",
+		     brasero_scsi_strerror (code));
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]