Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ nobase_pkginclude_HEADERS = \
libltfs/arch/arch_info.h \
libltfs/arch/time_internal.h \
libltfs/arch/errormap.h \
libltfs/arch/ltfs_arch_ops.h \
tape_drivers/ibm_tape.h \
tape_drivers/spc_op_codes.h \
tape_drivers/ssc_op_codes.h \
Expand Down
2 changes: 1 addition & 1 deletion src/iosched/cache_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
2 changes: 1 addition & 1 deletion src/iosched/cache_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
2 changes: 1 addition & 1 deletion src/iosched/fcfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
10 changes: 5 additions & 5 deletions src/iosched/unified.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -1742,7 +1742,7 @@ ssize_t _unified_insert_new_request(const char *buf, off_t offset, size_t count,
{
int ret;
struct dentry_priv *dpr = d->iosched_priv;
struct write_request *new_req;
struct write_request *new_req = NULL;
size_t copy_count;

if (! (*cache)) {
Expand All @@ -1764,7 +1764,7 @@ ssize_t _unified_insert_new_request(const char *buf, off_t offset, size_t count,
memcpy(cache_manager_get_object_data(*cache), buf, copy_count);

/* Store new write request */
new_req = calloc(1, sizeof(struct write_request));
new_req = (struct write_request*)calloc(1, sizeof(struct write_request));
if (! new_req) {
ltfsmsg(LTFS_ERR, 13018E);
_unified_cache_free(*cache, 0, priv);
Expand Down Expand Up @@ -2307,7 +2307,7 @@ int unified_set_profiler(char *work_dir, bool enable, void *iosched_handle)
{
int rc = 0;
char *path;
FILE *p;
FILE * p = NULL;
struct timer_info timerinfo;
struct unified_data *priv = iosched_handle;

Expand All @@ -2325,7 +2325,7 @@ int unified_set_profiler(char *work_dir, bool enable, void *iosched_handle)
return -LTFS_NO_MEMORY;
}

p = fopen(path, PROFILER_FILE_MODE);
arch_fopen(path, PROFILER_FILE_MODE,p);

free(path);

Expand Down
9 changes: 5 additions & 4 deletions src/kmi/flatfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -51,11 +51,12 @@
#include <errno.h>
#include "libltfs/kmi_ops.h"
#include "libltfs/ltfs_fuse_version.h"
#include <fuse.h>
#include "key_format_ltfs.h"

#include "key_format_ltfs.h"
#include <fuse.h>
#ifdef mingw_PLATFORM
#include "libltfs/arch/win/win_util.h"
#include "arch/win/win_util.h"

#endif

struct kmi_flatfile_options_data {
Expand Down
4 changes: 2 additions & 2 deletions src/kmi/key_format_ltfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -48,7 +48,7 @@
*/

#ifdef mingw_PLATFORM
#include "libltfs/arch/win/win_util.h"
#include "arch/win/win_util.h"
#endif
#include "libltfs/ltfs.h"
#include "libltfs/base64.h"
Expand Down
2 changes: 1 addition & 1 deletion src/kmi/key_format_ltfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
20 changes: 10 additions & 10 deletions src/kmi/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -49,11 +49,11 @@

#include "libltfs/kmi_ops.h"
#include "libltfs/ltfs_fuse_version.h"
#include <fuse.h>
#include "key_format_ltfs.h"

#include <fuse.h>
#ifdef mingw_PLATFORM
#include "libltfs/arch/win/win_util.h"
#include "arch/win/win_util.h"

#endif

struct kmi_simple_options_data {
Expand Down Expand Up @@ -193,20 +193,20 @@ int simple_parse_opts(void *opt_args)
+ strlen((char *) key[i].dk) + strlen(":") + strlen((char *) key[i].dki) + 1;

if (priv.dk_list)
priv.dk_list = realloc(priv.dk_list, dk_list_len);
priv.dk_list = (unsigned char*)realloc(priv.dk_list, dk_list_len);
else
priv.dk_list = calloc(dk_list_len, sizeof(unsigned char));
priv.dk_list = (unsigned char*)calloc(dk_list_len, sizeof(unsigned char));
if (priv.dk_list == NULL) {
ltfsmsg(LTFS_ERR, 10001E, __FUNCTION__);
return -LTFS_NO_MEMORY;
}
*(priv.dk_list + original_dk_list_len) = '\0';

if (original_dk_list_len)
strcat((char *) priv.dk_list, "/");
strcat((char *) priv.dk_list, (char *) key[i].dk);
strcat((char *) priv.dk_list, ":");
strcat((char *) priv.dk_list, (char *) key[i].dki);
arch_strcat((char *) priv.dk_list, dk_list_len, "/");
arch_strcat((char *) priv.dk_list, dk_list_len,(char *) key[i].dk);
arch_strcat((char *) priv.dk_list, dk_list_len, ":");
arch_strcat((char *) priv.dk_list, dk_list_len,(char *) key[i].dki);
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/libltfs/arch/arch_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2021 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
2 changes: 1 addition & 1 deletion src/libltfs/arch/arch_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
4 changes: 2 additions & 2 deletions src/libltfs/arch/errormap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -48,7 +48,7 @@
*/

#ifdef mingw_PLATFORM
#include "libltfs/arch/win/win_util.h"
#include "arch/win/win_util.h"
#endif

#ifdef __FreeBSD__
Expand Down
2 changes: 1 addition & 1 deletion src/libltfs/arch/errormap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
20 changes: 10 additions & 10 deletions src/libltfs/arch/filename_handling.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -55,7 +55,7 @@
bool _replace_invalid_chars(char * file_name, bool * dosdev);
char * _generate_target_file_name(const char *prefix, const char *extension, int suffix, bool dosdev);
int _utf8_strlen(const char *s);
int _utf8_strncpy(char *t, const char *s, int n);
int _utf8_strcpy(char *t, const char *s, int n);
#endif

/**
Expand All @@ -73,11 +73,11 @@ void update_platform_safe_name(struct dentry* dentry, bool handle_invalid_char,
char source_file_name[LTFS_FILENAME_MAX*4+1];
char *source_file_name_prefix, *source_file_name_extension;
char *target_file_name;
struct dentry *d;
struct dentry* d = NULL;
int ret;

dentry->platform_safe_name = NULL;
strcpy(source_file_name, dentry->name.name);
arch_strcpy_auto(source_file_name, dentry->name.name);

if (_replace_invalid_chars(source_file_name, &dosdev)) {
if (! handle_invalid_char)
Expand Down Expand Up @@ -130,7 +130,7 @@ void update_platform_safe_name(struct dentry* dentry, bool handle_invalid_char,
}
}
#else
dentry->platform_safe_name = strdup(dentry->name.name);
dentry->platform_safe_name = arch_strdup(dentry->name.name);
#endif
}

Expand Down Expand Up @@ -208,7 +208,7 @@ char * _generate_target_file_name(const char *prefix, const char *extension, int
target = NULL;

if (suffix) {
sprintf( suffix_string, "~%d", suffix );
arch_sprintf_auto( suffix_string, "~%d", suffix );

prefix_length = prefix ? _utf8_strlen(prefix) : 0;
extension_length = extension ? _utf8_strlen(extension) : 0;
Expand All @@ -218,15 +218,15 @@ char * _generate_target_file_name(const char *prefix, const char *extension, int
/* Need to trim source file name to add suffix */
if (! dosdev && prefix_length > suffix_length) {
/* Prefix is to be trimmed. */
_utf8_strncpy(trimmed_name, prefix, prefix_length - suffix_length);
_utf8_strcpy(trimmed_name, prefix, prefix_length - suffix_length);
if (extension)
ret = asprintf(&target, "%s%s.%s", trimmed_name, suffix_string, extension);
else
ret = asprintf(&target, "%s%s", trimmed_name, suffix_string);

} else if (extension_length > suffix_length) {
/* Extension is to be trimmed. */
_utf8_strncpy(trimmed_name, extension, extension_length - suffix_length);
_utf8_strcpy(trimmed_name, extension, extension_length - suffix_length);
ret = asprintf(&target, "%s%s.%s", prefix, suffix_string, trimmed_name);
} else {
/* Unable to generate target file name. NULL is to be returned. */
Expand All @@ -241,7 +241,7 @@ char * _generate_target_file_name(const char *prefix, const char *extension, int
if (extension)
ret = asprintf(&target, "%s.%s", prefix, extension);
else {
target = strdup(prefix);
target = arch_strdup(prefix);
ret = target ? strlen(target) : -1;
}
}
Expand Down Expand Up @@ -273,7 +273,7 @@ int _utf8_strlen(const char *s)
* @param s Source string to be copied.
* @param n Maximum length to be copied.
*/
int _utf8_strncpy(char *t, const char *s, int n)
int _utf8_strcpy(char *t, const char *s, int n)
{
int ret = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/libltfs/arch/filename_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** OO_Copyright_BEGIN
**
**
** Copyright 2010, 2020 IBM Corp. All rights reserved.
** Copyright 2010, 2025 IBM Corp. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
Expand Down
Loading
Loading