On Wed, Feb 23, 2011 at 10:17 PM, Peng Haitao <[email protected]> wrote:
> Hi Garrett,
>
> When executing "./syslogtst 1", the error message is follows:
> syslogtst: syslogtst.c:93: main: Assertion `ch1 != -1' failed.
How about this instead?
Thanks,
-Garrett
diff --git a/testcases/kernel/syscalls/syslog/syslogtst.c b/testcases/kernel/syscalls/syslog/syslogtst.c
index a229688..a56f22d 100644
--- a/testcases/kernel/syscalls/syslog/syslogtst.c
+++ b/testcases/kernel/syscalls/syslog/syslogtst.c
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
else if (argc == 2) {
ch = atoi(argv[1]);
- if (atoi(argv[1]) == 2 || atoi(argv[1]) == 8) {
+ if (ch == 2 || ch == 8) {
if (ch == 2)
ch1 = random() % 8;
if (ch == 8)
@@ -90,7 +90,8 @@ int main(int argc, char *argv[])
ch1 = atoi(argv[2]);
}
- assert (ch1 != -1);
+ /* Ensure ch1 is properly allocated when ch == 2 or ch == 8. */
+ assert (!((ch == 2 || ch == 8) && ch1 == -1));
/*
* Send syslog messages according to the case number, which
@@ -343,4 +344,4 @@ void sig_handler(int signal)
}
exit(signal);
-}
\ No newline at end of file
+}
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list