Replaced all occurances of ENOTSUP to EOPNOTSUPP to be in better harmony

with the kernel driver
edge.strict_endians
szaka 2005-08-01 22:10:38 +00:00
parent fd2e6eb09d
commit 06052dafcf
9 changed files with 53 additions and 50 deletions

View File

@ -23,6 +23,8 @@ xx/xx/xxxx - 1.12.0-WIP
- Fix ntfs_attr_p{read,write} to not return less bytes if trapped on
unmapped runlist region. (Yura)
- Make find work correctly on volumes mounted by ntfsmount. (Yura)
- Replaced all occurances of ENOTSUP to EOPNOTSUPP to be in better
harmony with the kernel driver. (Szaka)
20/07/2005 - 1.11.1 - Fix several ntfsmount bugs.
@ -475,10 +477,11 @@ xx/xx/xxxx - 1.12.0-WIP
text and other little bits.
- Add --disable-default-device-io-ops option to ./configure which makes
for a smaller libntfs but results in ntfs_mount() always returning
error with errno set to ENOTSUP. You need to use ntfs_device_mount()
instead. This only makes sense with "make libs" and when an
application linking statically against libntfs provides its own
device io operations. (Feature requested by Christophe Grenier.)
error with errno set to EOPNOTSUPP. You need to use
ntfs_device_mount() instead. This only makes sense with "make libs"
and when an application linking statically against libntfs provides
its own device io operations. (Feature requested by
Christophe Grenier.)
- Fix a duplicated free() in mkntfs. (Andras Erdei)
- Fix option display in mkntfs. (Andras Erdei)

View File

@ -85,7 +85,7 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
if (a->flags) {
Dputs("Encountered non-zero attribute flags. Cannot handle "
"this yet.");
errno = ENOTSUP;
errno = EOPNOTSUPP;
return 0;
}
if (!a->non_resident) {
@ -920,7 +920,7 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b)
// TODO: Implement writing compressed attributes! (AIA)
// return ntfs_attr_pwrite_compressed(ntfs_attr *na,
// const s64 pos, s64 count, void *b);
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}
if (!count)
@ -1292,7 +1292,7 @@ rl_err_out:
goto done;
// TODO: Need to try to change initialized_size. If it
// succeeds goto done, otherwise goto err_out. (AIA)
errno = ENOTSUP;
errno = EOPNOTSUPP;
goto err_out;
}
goto done;
@ -3810,11 +3810,11 @@ put_err_out:
*
* Return 0 on success and -1 on error with errno set to the error code. The
* following error codes are defined:
* EINVAL - Invalid arguments passed.
* EPERM - The attribute is not allowed to be resident.
* EIO - I/O error, damaged inode or bug.
* ENOSPC - There is no enough space to perform conversion.
* ENOTSUP - Requested conversion is not supported yet.
* EINVAL - Invalid arguments passed.
* EPERM - The attribute is not allowed to be resident.
* EIO - I/O error, damaged inode or bug.
* ENOSPC - There is no enough space to perform conversion.
* EOPNOTSUPP - Requested conversion is not supported yet.
*
* Warning: We do not set the inode dirty and we do not write out anything!
* We expect the caller to do this as this is a fairly low level
@ -3870,7 +3870,7 @@ static int ntfs_attr_make_resident(ntfs_attr *na, ntfs_attr_search_ctx *ctx)
Dprintf("%s(): Making compressed or encrypted files "
"resident is not implemented yet.\n",
__FUNCTION__);
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}
@ -4812,8 +4812,8 @@ put_err_out:
*
* On success return 0 and on error return -1 with errno set to the error code.
* The following error codes are defined:
* EINVAL - Invalid arguments were passed to the function.
* ENOTSUP - The desired resize is not implemented yet.
* EINVAL - Invalid arguments were passed to the function.
* EOPNOTSUPP - The desired resize is not implemented yet.
*/
int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize)
{
@ -4840,7 +4840,7 @@ int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize)
* TODO: Implement making handling of compressed attributes.
*/
if (NAttrCompressed(na)) {
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}
if (NAttrNonResident(na)) {

View File

@ -529,7 +529,7 @@ s64 ntfs_device_size_get(struct ntfs_device *dev, int block_size)
*
* The following error codes are defined:
* EINVAL Input parameter error
* ENOTSUP System does not support HDIO_GETGEO ioctl
* EOPNOTSUPP System does not support HDIO_GETGEO ioctl
* ENOTTY @dev is a file or a device not supporting HDIO_GETGEO
*/
s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev)
@ -548,7 +548,7 @@ s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev)
}
}
#else
errno = ENOTSUP;
errno = EOPNOTSUPP;
#endif
return -1;
}
@ -562,7 +562,7 @@ s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev)
*
* The following error codes are defined:
* EINVAL Input parameter error
* ENOTSUP System does not support HDIO_GETGEO ioctl
* EOPNOTSUPP System does not support HDIO_GETGEO ioctl
* ENOTTY @dev is a file or a device not supporting HDIO_GETGEO
*/
int ntfs_device_heads_get(struct ntfs_device *dev)
@ -582,7 +582,7 @@ int ntfs_device_heads_get(struct ntfs_device *dev)
}
}
#else
errno = ENOTSUP;
errno = EOPNOTSUPP;
#endif
return -1;
}
@ -596,7 +596,7 @@ int ntfs_device_heads_get(struct ntfs_device *dev)
*
* The following error codes are defined:
* EINVAL Input parameter error
* ENOTSUP System does not support HDIO_GETGEO ioctl
* EOPNOTSUPP System does not support HDIO_GETGEO ioctl
* ENOTTY @dev is a file or a device not supporting HDIO_GETGEO
*/
int ntfs_device_sectors_per_track_get(struct ntfs_device *dev)
@ -616,7 +616,7 @@ int ntfs_device_sectors_per_track_get(struct ntfs_device *dev)
}
}
#else
errno = ENOTSUP;
errno = EOPNOTSUPP;
#endif
return -1;
}

View File

@ -667,7 +667,7 @@ static int ntfs_mft_bitmap_extend_allocation(ntfs_volume *vol)
ntfs_error(vol->sb, "Not enough space in this mft record to "
"accommodate extended mft bitmap attribute "
"extent. Cannot handle this yet.");
errno = ENOTSUP;
errno = EOPNOTSUPP;
goto undo_alloc;
}
status.mp_rebuilt = 1;
@ -989,7 +989,7 @@ static int ntfs_mft_data_extend_allocation(ntfs_volume *vol)
ntfs_error(vol->sb, "Not enough space in this mft record to "
"accommodate extended mft data attribute "
"extent. Cannot handle this yet.");
errno = ENOTSUP;
errno = EOPNOTSUPP;
goto undo_alloc;
}
mp_rebuilt = TRUE;

View File

@ -1151,7 +1151,7 @@ ntfs_volume *ntfs_mount(const char *name __attribute__((unused)),
* defined as there are no device operations available in libntfs in
* this case.
*/
errno = ENOTSUP;
errno = EOPNOTSUPP;
return NULL;
#endif
}
@ -1341,8 +1341,8 @@ int ntfs_check_if_mounted(const char *file __attribute__((unused)),
* Return 0 if NTFS version is supported otherwise -1 with errno set.
*
* The following error codes are defined:
* ENOTSUP Unknown NTFS version
* EINVAL Invalid argument
* EOPNOTSUPP - Unknown NTFS version
* EINVAL - Invalid argument
*/
int ntfs_version_is_supported(ntfs_volume *vol)
{
@ -1365,7 +1365,7 @@ int ntfs_version_is_supported(ntfs_volume *vol)
if (NTFS_V3_0(major, minor) || NTFS_V3_1(major, minor))
return 0;
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}

View File

@ -127,7 +127,7 @@ static int ntfs_w32error_to_errno(unsigned int w32error)
case ERROR_NEGATIVE_SEEK:
return ESPIPE;
case ERROR_NOT_SUPPORTED:
return ENOTSUP;
return EOPNOTSUPP;
case ERROR_BAD_NETPATH:
return ENOSHARE;
default:
@ -787,7 +787,7 @@ static int ntfs_device_win32_open_partition(int drive_id,
"volumes are not supported in "
"R/W status yet");
CloseHandle(handle);
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}
fd->vol_handle = INVALID_HANDLE_VALUE;
@ -895,7 +895,7 @@ static s64 ntfs_device_win32_seek(struct ntfs_device *dev, s64 offset,
if (fd->part_length == -1) {
Dputs("win32_seek(): Error: Position relative to end "
"of disk not implemented.");
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}
abs_ofs = fd->part_length + offset;
@ -1404,7 +1404,7 @@ static int ntfs_device_win32_ioctl(struct ntfs_device *dev, int request,
*(int *)argp = (int)(fd->part_length / 512);
return 0;
}
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
#endif
#if defined(BLKGETSIZE64)
@ -1414,7 +1414,7 @@ static int ntfs_device_win32_ioctl(struct ntfs_device *dev, int request,
*(s64 *)argp = fd->part_length;
return 0;
}
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
#endif
#ifdef HDIO_GETGEO
@ -1429,7 +1429,7 @@ static int ntfs_device_win32_ioctl(struct ntfs_device *dev, int request,
#endif
default:
Dprintf("win32_ioctl(): unimplemented ioctl %d.\n", request);
errno = ENOTSUP;
errno = EOPNOTSUPP;
return -1;
}
}

View File

@ -320,7 +320,7 @@ decrypt_key_open_err:
fnCertFreeCertificateContext(pCert);
errno = EINVAL;
#else /* !defined(__CYGWIN__) */
errno = ENOTSUP;
errno = EOPNOTSUPP;
#endif /* !defined(__CYGWIN__) */
return NULL;
}
@ -722,7 +722,7 @@ ntfs_decrypt_data_key *ntfs_decrypt_data_key_open(unsigned char *data,
"and say that you saw this message. We will "
"then implement support for DES.\n");
free(key);
errno = ENOTSUP;
errno = EOPNOTSUPP;
return NULL;
}
if (key_size != wanted_key_size) {

View File

@ -1226,7 +1226,7 @@ static int insert_positioned_attr_in_mft_record(MFT_RECORD *m,
}
if (ic == IGNORE_CASE) {
Eprintf("FIXME: Hit unimplemented code path #1.\n");
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (!ntfs_attr_lookup(type, uname, name_len, ic, 0, NULL, 0, ctx)) {
@ -1243,12 +1243,12 @@ static int insert_positioned_attr_in_mft_record(MFT_RECORD *m,
Eprintf("Compressed attributes not supported yet.\n");
// FIXME: Compress attribute into a temporary buffer, set
// val accordingly and save the compressed size.
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (flags & (ATTR_IS_ENCRYPTED || ATTR_IS_SPARSE)) {
Eprintf("Encrypted/sparse attributes not supported yet.\n");
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (flags & ATTR_COMPRESSION_MASK) {
@ -1299,7 +1299,7 @@ static int insert_positioned_attr_in_mft_record(MFT_RECORD *m,
// record.
// FIXME: the check for needing extension records should be
// earlier on as it is very quick: asize > m->bytes_allocated?
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
#ifdef DEBUG
@ -1341,7 +1341,7 @@ static int insert_positioned_attr_in_mft_record(MFT_RECORD *m,
a->compressed_size = cpu_to_le64(0);
// FIXME: Write out the compressed data.
// FIXME: err = build_mapping_pairs_compressed();
err = -ENOTSUP;
err = -EOPNOTSUPP;
} else {
a->compression_unit = 0;
bw = ntfs_rlwrite(vol->dev, rl, val, val_len, &inited_size);
@ -1411,7 +1411,7 @@ static int insert_non_resident_attr_in_mft_record(MFT_RECORD *m,
}
if (ic == IGNORE_CASE) {
Eprintf("FIXME: Hit unimplemented code path #2.\n");
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (!ntfs_attr_lookup(type, uname, name_len, ic, 0, NULL, 0, ctx)) {
@ -1428,12 +1428,12 @@ static int insert_non_resident_attr_in_mft_record(MFT_RECORD *m,
Eprintf("Compressed attributes not supported yet.\n");
// FIXME: Compress attribute into a temporary buffer, set
// val accordingly and save the compressed size.
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (flags & (ATTR_IS_ENCRYPTED || ATTR_IS_SPARSE)) {
Eprintf("Encrypted/sparse attributes not supported yet.\n");
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (val_len) {
@ -1486,7 +1486,7 @@ static int insert_non_resident_attr_in_mft_record(MFT_RECORD *m,
// record.
// FIXME: the check for needing extension records should be
// earlier on as it is very quick: asize > m->bytes_allocated?
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
#ifdef DEBUG
@ -1531,7 +1531,7 @@ static int insert_non_resident_attr_in_mft_record(MFT_RECORD *m,
a->compressed_size = cpu_to_le64(0);
// FIXME: Write out the compressed data.
// FIXME: err = build_mapping_pairs_compressed();
err = -ENOTSUP;
err = -EOPNOTSUPP;
} else {
a->compression_unit = 0;
bw = ntfs_rlwrite(vol->dev, rl, val, val_len, NULL);
@ -1600,7 +1600,7 @@ static int insert_resident_attr_in_mft_record(MFT_RECORD *m,
}
if (ic == IGNORE_CASE) {
Eprintf("FIXME: Hit unimplemented code path #3.\n");
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
if (!ntfs_attr_lookup(type, uname, name_len, ic, 0, val, val_len,
@ -1632,7 +1632,7 @@ static int insert_resident_attr_in_mft_record(MFT_RECORD *m,
// record.
// FIXME: the check for needing extension records should be
// earlier on as it is very quick: asize > m->bytes_allocated?
err = -ENOTSUP;
err = -EOPNOTSUPP;
goto err_out;
}
#ifdef DEBUG
@ -2121,7 +2121,7 @@ static int upgrade_to_large_index(MFT_RECORD *m, const char *name,
}
if (ic == IGNORE_CASE) {
Eprintf("FIXME: Hit unimplemented code path #4.\n");
err = -ENOTSUP;
err = -EOPNOTSUPP;
if (uname)
free(uname);
goto err_out;

View File

@ -2184,7 +2184,7 @@ static ntfs_volume *mount_volume(void)
printf(corrupt_volume_msg);
else if (err == EPERM)
printf(hibernated_volume_msg);
else if (err == EOPNOTSUPP) /* NOTE: same as ENOTSUP !!! */
else if (err == EOPNOTSUPP)
printf(unclean_journal_msg);
exit(1);
}