Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 59c6310
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
10 changes: 5 additions & 5 deletions src/archiver_iso9660.c
Expand Up @@ -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 */


Expand Down Expand Up @@ -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 */


Expand Down
10 changes: 5 additions & 5 deletions src/archiver_lzma.c
Expand Up @@ -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 */


Expand Down Expand Up @@ -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 */


Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions src/archiver_qpak.c
Expand Up @@ -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 */


Expand Down Expand Up @@ -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 */


Expand Down
10 changes: 5 additions & 5 deletions src/archiver_unpacked.c
Expand Up @@ -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 */


Expand Down Expand Up @@ -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 */


Expand Down
12 changes: 5 additions & 7 deletions src/archiver_zip.c
Expand Up @@ -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 */


Expand Down Expand Up @@ -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 */


Expand All @@ -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 */


Expand Down

0 comments on commit 59c6310

Please sign in to comment.