Skip to content
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

Created functionality for creating dataset members #68

Open
wants to merge 1 commit into
base: feature/staging-int
Choose a base branch
from

Conversation

chcaron01
Copy link

Signed-off-by: Charlie Caron [email protected]

@chcaron01
Copy link
Author

@jordanfilteau1995

c/datasetjson.c Outdated Show resolved Hide resolved
c/datasetjson.c Outdated Show resolved Hide resolved
c/datasetjson.c Outdated Show resolved Hide resolved
c/datasetjson.c Outdated Show resolved Hide resolved
@jordanfilteau1995
Copy link
Contributor

DO NOT MERGE until merge conflicts are resolved in zowe/zss#62

Volser volser = {0};

DatasetName dsn = {0};
memcpy(dsn.value, datasetName, DATASET_NAME_LEN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A dataset name is not necessarily DATASET_NAME_LEN bytes. This may 0C4. And for DSCB it probably needs to be space padded.

char dscb[INDEXED_DSCB] = {0};
int bufferSize = sizeof(dscb);
if (getDSCB(datasetPath, dscb, bufferSize) != 0) {
respondWithJsonError(response, "Error decoding dataset", 400, "Bad Request");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you return from here early and not have a huge else?

respondWithJsonError(response, "Error decoding dataset", 400, "Bad Request");
}
else {
if (!isPartionedDataset(dscb)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Just check and return in case of an error.

}
}

void newDatasetMember(HttpResponse* response, char* datasetPath, char* memberName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not follow the same convention as the rest of the function, i.e. require a full path? Please also do all the validation and checks (whether the dataset is on an offline volume), that's done in https://github.com/zowe/zowe-common-c/blob/staging/c/datasetjson.c#L832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants