-
Notifications
You must be signed in to change notification settings - Fork 30
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
base: feature/staging-int
Are you sure you want to change the base?
Conversation
Signed-off-by: Charlie Caron <[email protected]>
cbbbe61
to
d9d5f84
Compare
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); |
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.
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"); |
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.
Can you return from here early and not have a huge else
?
respondWithJsonError(response, "Error decoding dataset", 400, "Bad Request"); | ||
} | ||
else { | ||
if (!isPartionedDataset(dscb)) { |
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 here. Just check and return in case of an error.
} | ||
} | ||
|
||
void newDatasetMember(HttpResponse* response, char* datasetPath, char* memberName) { |
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 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
Signed-off-by: Charlie Caron [email protected]