[04/11] syslog: Update misc/tst-syslog to check reported %n value
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
Commit Message
---
misc/tst-syslog.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Comments
The change LGTM, just that it does not follow current file indentation
(tabs instead of whitespace).
On 09/02/24 12:25, Florian Weimer wrote:
> ---
> misc/tst-syslog.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c
> index ced9ae8467..741693a7ff 100644
> --- a/misc/tst-syslog.c
> +++ b/misc/tst-syslog.c
> @@ -102,8 +102,10 @@ send_vsyslog (int options)
> {
> int facility = facilities[i];
> int priority = priorities[j];
> - call_vsyslog (facility | priority, "%s %d %d", SYSLOG_MSG_BASE,
> - facility, priority);
> + int pos = -1;
> + call_vsyslog (facility | priority, "%n%s %d %d",
> + &pos, SYSLOG_MSG_BASE, facility, priority);
> + TEST_COMPARE (pos, 0);
> }
> }
> }
> @@ -117,8 +119,10 @@ send_syslog (int options)
> {
> int facility = facilities[i];
> int priority = priorities[j];
> - syslog (facility | priority, "%s %d %d", SYSLOG_MSG_BASE, facility,
> - priority);
> + int pos = -1;
> + syslog (facility | priority, "%n%s %d %d",
> + &pos, SYSLOG_MSG_BASE, facility, priority);
> + TEST_COMPARE (pos, 0);
> }
> }
> }
* Adhemerval Zanella Netto:
> The change LGTM, just that it does not follow current file indentation
> (tabs instead of whitespace).
The file uses tabs elsewhere (e.g., to indent the parameter list in
check_syslog_message_large), that's why Emacs turned on tabs. Just not
in the edited places.
Thanks,
Florian
@@ -102,8 +102,10 @@ send_vsyslog (int options)
{
int facility = facilities[i];
int priority = priorities[j];
- call_vsyslog (facility | priority, "%s %d %d", SYSLOG_MSG_BASE,
- facility, priority);
+ int pos = -1;
+ call_vsyslog (facility | priority, "%n%s %d %d",
+ &pos, SYSLOG_MSG_BASE, facility, priority);
+ TEST_COMPARE (pos, 0);
}
}
}
@@ -117,8 +119,10 @@ send_syslog (int options)
{
int facility = facilities[i];
int priority = priorities[j];
- syslog (facility | priority, "%s %d %d", SYSLOG_MSG_BASE, facility,
- priority);
+ int pos = -1;
+ syslog (facility | priority, "%n%s %d %d",
+ &pos, SYSLOG_MSG_BASE, facility, priority);
+ TEST_COMPARE (pos, 0);
}
}
}