From 78d8f90ffae45808096133c461ef1ee0e65de937 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 26 Oct 1997 01:53:39 +0000 Subject: [PATCH] bmap.c: Fix buggy use of the INLINE macros. ChangeLog, dblist.c, ext2_err.et.in, mkdir.c: dblist.c, mkdir.c: use EXT2_DIR_EXISTS and EXT2_DB_NOT_FOUND instead of the system error messages. ext2_err.et.in: Added new error messages EXT2_DIR_EXISTS and EXT2_DB_NOT_FOUND --- lib/ext2fs/ChangeLog | 6 ++++++ lib/ext2fs/bmap.c | 2 +- lib/ext2fs/dblist.c | 2 +- lib/ext2fs/ext2_err.et.in | 8 +++++++- lib/ext2fs/mkdir.c | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 70a19f3..a06a79f 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,11 @@ Sat Oct 25 00:06:58 1997 Theodore Ts'o + * dblist.c, mkdir.c: use EXT2_DIR_EXISTS and EXT2_DB_NOT_FOUND + instead of the system error messages. + + * ext2_err.et.in: Added new error messages EXT2_DIR_EXISTS and + EXT2_DB_NOT_FOUND + * ext2fs.h: Added function declarations and constants for bmap.c and fileio.c. diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c index 3081926..b2d3eac 100644 --- a/lib/ext2fs/bmap.c +++ b/lib/ext2fs/bmap.c @@ -20,7 +20,7 @@ #include "ext2fs.h" -#ifdef NO_INLINE_FUNCS +#if defined(__GNUC__) && !defined(NO_INLINE_FUNCS) #define _BMAP_INLINE_ __inline__ #else #define _BMAP_INLINE_ diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c index 867ba9a..1a4c5dc 100644 --- a/lib/ext2fs/dblist.c +++ b/lib/ext2fs/dblist.c @@ -190,7 +190,7 @@ errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ino_t ino, blk_t blk, dblist->sorted = 0; return 0; } - return ENOENT; + return EXT2_DB_NOT_FOUND; } /* diff --git a/lib/ext2fs/ext2_err.et.in b/lib/ext2fs/ext2_err.et.in index 69ec87b..3d4667c 100644 --- a/lib/ext2fs/ext2_err.et.in +++ b/lib/ext2fs/ext2_err.et.in @@ -138,7 +138,7 @@ ec EXT2_ET_NO_INODE_BITMAP, "Inode bitmap not loaded" ec EXT2_ET_NO_BLOCK_BITMAP, - "BLOCK bitmap not loaded" + "Block bitmap not loaded" ec EXT2_ET_BAD_INODE_NUM, "Illegal inode number" @@ -251,4 +251,10 @@ ec EXT2_FILE_NOT_FOUND, ec EXT2_FILE_RO, "File open read-only" +ec EXT2_DB_NOT_FOUND, + "Ext2 directory block not found" + +ec EXT2_DIR_EXISTS, + "Ext2 directory already exists" + end diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c index 4a9f824..e4524a8 100644 --- a/lib/ext2fs/mkdir.c +++ b/lib/ext2fs/mkdir.c @@ -107,7 +107,7 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum, retval = ext2fs_lookup(fs, parent, name, strlen(name), 0, &scratch_ino); if (!retval) { - retval = EEXIST; + retval = EXT2_DIR_EXISTS; name = 0; goto cleanup; } -- 1.8.3.1