-
Notifications
You must be signed in to change notification settings - Fork 23
Various enhancements for zopen tools #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/zos-char-util.cc
Outdated
| if (ccsid == 1047 && len == cnt) { | ||
| if (no_tag_read_behaviour == __NO_TAG_READ_DEFAULT_WITHWARNING) { | ||
| if (name) { | ||
| len = strlen(name) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor thing but i would typically have len be the strlen and then allocate the buffer to len+1 since you don't need to convert a 0 to a 0.
But perhaps just me.
src/zos-char-util.cc
Outdated
| return 1; | ||
| } | ||
| } // cnt > 8 | ||
| fdcache.set_attribute(fd, 0x0000000000020000UL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a name for the magic number?
src/zos-io.cc
Outdated
| size_t pos = 0; | ||
|
|
||
| if (*lineptr == NULL || *n == 0) { | ||
| *n = 128; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 128? and why 2 farther down? would those be good to have as buffer length and growth size macros (assuming that's what they are?)
src/zos-io.cc
Outdated
| int c; | ||
|
|
||
| if (buf == NULL || bufsize == 0) { | ||
| bufsize = 128; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above.
MikeFultonDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed - minor comments.
|
Added a readlink override to address zopencommunity/coreutilsport#74 and zopencommunity/gitport#122 |
src/zos-io.cc
Outdated
| *lineptr = (char *)malloc(*n); | ||
| if (*lineptr == NULL || *n == 0) { | ||
| *n = 120; | ||
| *lineptr = (char *)realloc(*lineptr, *n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling realloc() this way is incorrect. If the memory allocation fails, then the original value of lineptr is lost, and the memory it pointed to is leaked. cppcheck complains about this, and suggests you use a temporary pointer to hold the return value, and then assign it to lineptr after validation.
https://stackoverflow.com/questions/21006707/proper-usage-of-realloc
- Override pthread_create to always set autocvt=on - Modify untagged heuristic to remove restriction on min required bytes (8) - Add tests
5bbcd18 to
b0cd547
Compare
| #if (__TARGET_LIB__ < 0x42050000) || \ | ||
| (__TARGET_LIB__ >= 0x42050000 && \ | ||
| (((_POSIX_C_SOURCE + 0) < 200809L) && !defined(_XPLATFORM_SOURCE))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #if (__TARGET_LIB__ < 0x42050000) || \ | |
| (__TARGET_LIB__ >= 0x42050000 && \ | |
| (((_POSIX_C_SOURCE + 0) < 200809L) && !defined(_XPLATFORM_SOURCE))) | |
| #if (__TARGET_LIB__ < 0x42050000) || \ | |
| (((_POSIX_C_SOURCE + 0) < 200809L) && !defined(_XPLATFORM_SOURCE)) |
If a is not < b then a >= b. Same applies to the change in zos-getentropy.h (and a few other places).
… works in fopen in addition to open
…n() existing behaviour
* fix: fdopendir and statfs conflict override * feat: strerror without EDC prefix * fix: get rid of fdopendir * fix: get rid of _Packed (maintenance) * refactor: igor - make changes consistent with zoslib * fix: strerror not working due to linker * Update include/zos-v2r5-symbolfixes.h Co-authored-by: Igor Todorovski <[email protected]> * Update include/dirent.h Co-authored-by: Igor Todorovski <[email protected]> * document statfs override --------- Co-authored-by: Igor Todorovski <[email protected]>
* feat: aligned operator new and delete * add todo
* Add initial implementation of ptrace and tests * Guard clock_gettime and nanosleep in time.h to fix build error in zstd * Use _Z_EXPORT in ptrace
* Add error function * Fix various warnings * revert issue * Further updates
* Add mount readonly flag, spawn setsigdefault * Add duplocale. Introduce macro to use zoslib locale
* Add scandir, timegm implementation * Add portable remove_all function * Define FNM_EXTMATCH * Add cpp guard for filesystem header
This commit introduces the `__UNTAGGED_FILE_ENCODING` environment variable, which deprecates `__UNTAGGED_READ_MODE`, to control the handling of untagged files. The implementation prioritizes the new variable, falling back to the old one for compatibility. Documentation and tests have been updated accordingly.
This reverts commit 2b9235e.
Uh oh!
There was an error while loading. Please reload this page.