-
Notifications
You must be signed in to change notification settings - Fork 358
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
Return the actual default partition in dds_qget_partition() whenever possible #1824
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -618,8 +618,20 @@ bool dds_qget_partition (const dds_qos_t * __restrict qos, uint32_t *n, char *** | |
*n = qos->partition.n; | ||
if (ps) | ||
{ | ||
if (qos->partition.n == 0) | ||
*ps = NULL; | ||
if (qos->partition.n == 0) { | ||
/* This is the default partition. | ||
* Only when the argument n is non-null, we'll | ||
* actually return the default partition (i.e., | ||
* the empty string ""). | ||
* */ | ||
if (n) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 615 & 616 ensure (ps ≠ |
||
*n = 1; | ||
*ps = dds_alloc (sizeof (char*)); | ||
(*ps)[0] = dds_string_dup (""); | ||
} else { | ||
*ps = NULL; | ||
} | ||
} | ||
else | ||
{ | ||
*ps = dds_alloc (sizeof (char*) * qos->partition.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.
I don't like the behaviour that, for an entity created with an empty set of partitions:
will fail.