Author: pollux
Date: 2007-01-13 22:06:06 +0000 (Sat, 13 Jan 2007)
New Revision: 24429

Modified:
   xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c
Log:
use open, write and close instead of fopen, fwrite, fclose

Modified: 
xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c  
2007-01-13 21:58:01 UTC (rev 24428)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c  
2007-01-13 22:06:06 UTC (rev 24429)
@@ -25,6 +25,10 @@
 #include <string.h>
 #endif
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
 #include <errno.h>
 
 #include "xfburn-global.h"
@@ -287,13 +291,13 @@
 thread_write_iso (ThreadWriteIsoParams * params)
 {
   GtkWidget *dialog_progress = params->dialog_progress;
-  FILE *fd = NULL;
+  gint fd;
   guchar buf[2048];
   glong size = 0;
   glong written = 0;
 
-  fd = fopen(params->iso_path, "w");
-  if (fd == NULL) {
+  fd = open (params->iso_path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+  if (fd == -1) {
     /* could not create destination */
     gchar err[256];
     gchar *error_msg = NULL;
@@ -311,7 +315,7 @@
 
   size = (glong) params->src->get_size (params->src);
   while (params->src->read (params->src, buf, 2048) == 2048) {
-    if ( (fwrite(buf, 1, 2048, fd) < 2048) && (ferror (fd) > 0)) {
+    if (write (fd, buf, 2048) < 2048) {
       /* an error occured while writing */
       gchar err[256];
       gchar *error_msg = NULL;
@@ -334,7 +338,7 @@
   xfburn_progress_dialog_set_status_with_text (XFBURN_PROGRESS_DIALOG 
(dialog_progress), XFBURN_PROGRESS_DIALOG_STATUS_COMPLETED, _("Done"));
 
  cleanup:
-  fclose (fd);
+  close (fd);
  end:
   burn_source_free (params->src);
   g_free (params->iso_path);

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to