Removed a FIXME: use correct error code for writing to read-only archives.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 22 Mar 2012 00:05:10 -0400
changeset 1247 4ea4710d4863
parent 1246 4fa9fe3e0b52
child 1248 632895970ed6
Removed a FIXME: use correct error code for writing to read-only archives.
src/archiver_iso9660.c
src/archiver_lzma.c
src/archiver_qpak.c
src/archiver_unpacked.c
src/archiver_zip.c
--- a/src/archiver_iso9660.c	Wed Mar 21 23:59:43 2012 -0400
+++ b/src/archiver_iso9660.c	Thu Mar 22 00:05:10 2012 -0400
@@ -501,7 +501,7 @@
 
 static PHYSFS_sint64 ISO9660_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 l)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, -1);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, -1);
 } /* ISO9660_write */
 
 
@@ -921,25 +921,25 @@
 
 static PHYSFS_Io *ISO9660_openWrite(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* ISO9660_openWrite */
 
 
 static PHYSFS_Io *ISO9660_openAppend(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* ISO9660_openAppend */
 
 
 static int ISO9660_remove(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* ISO9660_remove */
 
 
 static int ISO9660_mkdir(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* ISO9660_mkdir */
 
 
--- a/src/archiver_lzma.c	Wed Mar 21 23:59:43 2012 -0400
+++ b/src/archiver_lzma.c	Thu Mar 22 00:05:10 2012 -0400
@@ -364,7 +364,7 @@
 
 static PHYSFS_sint64 LZMA_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 len)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, -1);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, -1);
 } /* LZMA_write */
 
 
@@ -599,13 +599,13 @@
 
 static PHYSFS_Io *LZMA_openWrite(dvoid *opaque, const char *filename)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* LZMA_openWrite */
 
 
 static PHYSFS_Io *LZMA_openAppend(dvoid *opaque, const char *filename)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* LZMA_openAppend */
 
 
@@ -629,13 +629,13 @@
 
 static int LZMA_remove(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* LZMA_remove */
 
 
 static int LZMA_mkdir(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* LZMA_mkdir */
 
 static int LZMA_stat(dvoid *opaque, const char *filename, int *exists,
--- a/src/archiver_qpak.c	Wed Mar 21 23:59:43 2012 -0400
+++ b/src/archiver_qpak.c	Thu Mar 22 00:05:10 2012 -0400
@@ -98,7 +98,7 @@
 
 static PHYSFS_sint64 QPAK_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 len)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, -1);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, -1);
 } /* QPAK_write */
 
 
@@ -491,25 +491,25 @@
 
 static PHYSFS_Io *QPAK_openWrite(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* QPAK_openWrite */
 
 
 static PHYSFS_Io *QPAK_openAppend(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* QPAK_openAppend */
 
 
 static int QPAK_remove(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* QPAK_remove */
 
 
 static int QPAK_mkdir(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* QPAK_mkdir */
 
 
--- a/src/archiver_unpacked.c	Wed Mar 21 23:59:43 2012 -0400
+++ b/src/archiver_unpacked.c	Thu Mar 22 00:05:10 2012 -0400
@@ -62,7 +62,7 @@
 
 static PHYSFS_sint64 UNPK_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 len)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, -1);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, -1);
 } /* UNPK_write */
 
 
@@ -259,25 +259,25 @@
 
 PHYSFS_Io *UNPK_openWrite(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* UNPK_openWrite */
 
 
 PHYSFS_Io *UNPK_openAppend(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* UNPK_openAppend */
 
 
 int UNPK_remove(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* UNPK_remove */
 
 
 int UNPK_mkdir(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* UNPK_mkdir */
 
 
--- a/src/archiver_zip.c	Wed Mar 21 23:59:43 2012 -0400
+++ b/src/archiver_zip.c	Thu Mar 22 00:05:10 2012 -0400
@@ -250,11 +250,9 @@
 } /* ZIP_read */
 
 
-/* !!! FIXME: write stuff should be ERR_READ_ONLY, not ERR_UNSUPPORTED */
-/* !!! FIXME:  ... all the archivers do this. */
 static PHYSFS_sint64 ZIP_write(PHYSFS_Io *io, const void *b, PHYSFS_uint64 len)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, -1);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, -1);
 } /* ZIP_write */
 
 
@@ -1332,13 +1330,13 @@
 
 static PHYSFS_Io *ZIP_openWrite(dvoid *opaque, const char *filename)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* ZIP_openWrite */
 
 
 static PHYSFS_Io *ZIP_openAppend(dvoid *opaque, const char *filename)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
 } /* ZIP_openAppend */
 
 
@@ -1353,13 +1351,13 @@
 
 static int ZIP_remove(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* ZIP_remove */
 
 
 static int ZIP_mkdir(dvoid *opaque, const char *name)
 {
-    BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, 0);
+    BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
 } /* ZIP_mkdir */