From: Markos Chandras <Markos.Chandras@imgtec.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH 05/21] syscalls: Cast st_nlink variables to proper integers
Date: Tue, 3 Jan 2012 10:42:55 +0000 [thread overview]
Message-ID: <4F02DBAF.5040202@imgtec.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Hi, please review the attached patch
--
markos
[-- Attachment #2: 0005-syscalls-Cast-st_nlink-variables-to-proper-integers.patch --]
[-- Type: text/plain, Size: 3759 bytes --]
From 5597051818cb71032d6d2dc9eaa16ab417e9c79e Mon Sep 17 00:00:00 2001
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Thu, 22 Dec 2011 11:44:18 +0000
Subject: [PATCH 05/21] syscalls: Cast st_nlink variables to proper integers
st_nlink type is arch specific so it may not be a 32-bit integer everywhere.
Since %d modifier expects an integer, the st_nlink variables need to be casted
to an integer type.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
testcases/kernel/syscalls/link/link02.c | 2 +-
testcases/kernel/syscalls/link/link03.c | 4 ++--
testcases/kernel/syscalls/link/link05.c | 4 ++--
testcases/kernel/syscalls/symlink/symlink01.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/testcases/kernel/syscalls/link/link02.c b/testcases/kernel/syscalls/link/link02.c
index 4ddd818..f6cdf9f 100644
--- a/testcases/kernel/syscalls/link/link02.c
+++ b/testcases/kernel/syscalls/link/link02.c
@@ -190,7 +190,7 @@ int main(int ac, char **av)
tst_resm(TFAIL,
"link(%s, %s) returned %ld, stat link cnts do not match %d %d",
Fname, Lname, TEST_RETURN,
- fbuf.st_nlink, lbuf.st_nlink);
+ (int)fbuf.st_nlink, (int)lbuf.st_nlink);
}
}
if (unlink(Lname) == -1) {
diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
index f2f85b5..b3b4387 100644
--- a/testcases/kernel/syscalls/link/link03.c
+++ b/testcases/kernel/syscalls/link/link03.c
@@ -232,7 +232,7 @@ int main(int ac, char **av)
"link(%s, %s[1-%d]) ret %ld for %d files, stat values do not match %d %d",
Fname, Basename, nlinks,
TEST_RETURN, nlinks,
- fbuf.st_nlink, lbuf.st_nlink);
+ (int)fbuf.st_nlink, (int)lbuf.st_nlink);
break;
}
}
@@ -240,7 +240,7 @@ int main(int ac, char **av)
tst_resm(TPASS,
"link(%s, %s[1-%d]) ret %ld for %d files, stat linkcounts match %d",
Fname, Basename, nlinks, TEST_RETURN,
- nlinks, fbuf.st_nlink);
+ nlinks, (int)fbuf.st_nlink);
}
} else
Tst_count++;
diff --git a/testcases/kernel/syscalls/link/link05.c b/testcases/kernel/syscalls/link/link05.c
index 343db1b..f03a149 100644
--- a/testcases/kernel/syscalls/link/link05.c
+++ b/testcases/kernel/syscalls/link/link05.c
@@ -217,7 +217,7 @@ int main(int ac, char **av)
"link(%s, %s[1-%d]) ret %ld for %d files, stat values do not match %d %d",
Fname, Basename, nlinks,
TEST_RETURN, nlinks,
- fbuf.st_nlink, lbuf.st_nlink);
+ (int)fbuf.st_nlink, (int)lbuf.st_nlink);
break;
}
}
@@ -225,7 +225,7 @@ int main(int ac, char **av)
tst_resm(TPASS,
"link(%s, %s[1-%d]) ret %ld for %d files, stat linkcounts match %d",
Fname, Basename, nlinks, TEST_RETURN,
- nlinks, fbuf.st_nlink);
+ nlinks, (int)fbuf.st_nlink);
}
} else
Tst_count++;
diff --git a/testcases/kernel/syscalls/symlink/symlink01.c b/testcases/kernel/syscalls/symlink/symlink01.c
index c7be331..94596d0 100644
--- a/testcases/kernel/syscalls/symlink/symlink01.c
+++ b/testcases/kernel/syscalls/symlink/symlink01.c
@@ -1556,8 +1556,8 @@ struct all_test_cases *tc_ptr;
tst_resm(TFAIL,
"%slink(%s, %s) failed to adjust link count.\n\
count for nick is %d, count for %s is %d, count for %s is %d.",
- Buffer, tc_ptr->fn_arg[1], "nick", statter.st_nlink, tc_ptr->fn_arg[1], asymlink.st_nlink, tc_ptr->fn_arg[2],
- stbuf.st_nlink);
+ Buffer, tc_ptr->fn_arg[1], "nick", (int)statter.st_nlink, tc_ptr->fn_arg[1], (int)asymlink.st_nlink, tc_ptr->fn_arg[2],
+ (int) stbuf.st_nlink);
}
} else {
tst_resm(TFAIL, "%sA lstat of %s (ino:%jd) and of\n\t\t\
--
1.7.1
[-- Attachment #3: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2012-01-03 10:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-03 10:42 Markos Chandras [this message]
2012-01-03 19:35 ` [LTP] [PATCH 05/21] syscalls: Cast st_nlink variables to proper integers Garrett Cooper
2012-01-03 20:37 ` Mike Frysinger
2012-01-03 20:51 ` Garrett Cooper
2012-01-03 20:57 ` Mike Frysinger
2012-01-03 22:19 ` Garrett Cooper
2012-01-03 23:34 ` Mike Frysinger
2012-01-03 23:52 ` Garrett Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F02DBAF.5040202@imgtec.com \
--to=markos.chandras@imgtec.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox