[LTP] [PATCH] getdomainname/getdomainname01: Convert to new API
Li Wang
liwang@redhat.com
Thu Nov 4 02:54:54 CET 2021
Hi Meng,
I made some clean-up and pushed.
Changes like:
--- a/testcases/kernel/syscalls/getdomainname/getdomainname01.c
+++ b/testcases/kernel/syscalls/getdomainname/getdomainname01.c
@@ -13,29 +13,16 @@
* It is intended to provide a limited exposure of the system call.
*/
-#include <errno.h>
#include <linux/utsname.h>
#include "tst_test.h"
#define MAX_NAME_LEN __NEW_UTS_LEN
-static char domain_name[MAX_NAME_LEN];
-
static void verify_getdomainname(void)
{
- /*
- * Call getdomainname(2)
- */
- TEST(getdomainname(domain_name, sizeof(domain_name)));
+ char domain_name[MAX_NAME_LEN];
- /* check return code */
- if (TST_RET == -1) {
- tst_res(TFAIL, "getdomainname() Failed, errno = %d :"
- " %s", TST_ERR, strerror(TST_ERR));
- } else {
- tst_res(TPASS, "getdomainname() returned %ld ",
- TST_RET);
- }
+ TST_EXP_PASS(getdomainname(domain_name, sizeof(domain_name)));
}
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211104/35ffa269/attachment.htm>
More information about the ltp
mailing list