Skip to content
Permalink
Browse files
Removed a FIXME: use correct error code for writing to read-only arch…
…ives.
  • Loading branch information
icculus committed Mar 22, 2012
1 parent 60aa0e4 commit 59c6310e920435b0c52941cbbdb5e29ffd63a8a1
Showing with 25 additions and 27 deletions.
  1. +5 −5 src/archiver_iso9660.c
  2. +5 −5 src/archiver_lzma.c
  3. +5 −5 src/archiver_qpak.c
  4. +5 −5 src/archiver_unpacked.c
  5. +5 −7 src/archiver_zip.c
@@ -501,7 +501,7 @@ static PHYSFS_sint64 ISO9660_read(PHYSFS_Io *io, void *buf, PHYSFS_uint64 len)

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 int ISO9660_stat(dvoid *opaque, const char *name, int *exists,

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 */


@@ -364,7 +364,7 @@ static PHYSFS_sint64 LZMA_read(PHYSFS_Io *io, void *outBuf, PHYSFS_uint64 len)

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_openRead(dvoid *opaque, const char *name, int *fileExists

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 void LZMA_dirClose(dvoid *opaque)

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,
@@ -98,7 +98,7 @@ static PHYSFS_sint64 QPAK_read(PHYSFS_Io *io, void *buffer, PHYSFS_uint64 len)

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_openRead(dvoid *opaque, const char *fnm, int *fileExists)

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 */


@@ -62,7 +62,7 @@ static PHYSFS_sint64 UNPK_read(PHYSFS_Io *io, void *buffer, PHYSFS_uint64 len)

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_openRead(dvoid *opaque, const char *fnm, int *fileExists)

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 */


@@ -250,11 +250,9 @@ static PHYSFS_sint64 ZIP_read(PHYSFS_Io *_io, void *buf, PHYSFS_uint64 len)
} /* 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_openRead(dvoid *opaque, const char *fnm, int *fileExists)

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 void ZIP_dirClose(dvoid *opaque)

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 */


0 comments on commit 59c6310

Please sign in to comment.