On Tue, Jul 21, 2009 at 9:38 PM, Garrett Cooper<[email protected]> wrote:
> On Tue, Jul 21, 2009 at 2:28 PM, Mike Frysinger<[email protected]> wrote:
>> On Tuesday 21 July 2009 10:21:44 Garrett Cooper wrote:
>>> I was tempted to fix the format string error, but I don't know what
>>> the potential implications are of switching the data type from
>>> u_int64_t to unsigned long long...
>>
>> dont do that.  just use the proper format string from inttypes.h.
>> uint64_t f;
>> printf("f = %"PRIu64"\n", f);
>>
>>> +/* Dummy function reference to avoid compiler warning from
>>> linux_syscall_numbers.h. */
>>> +extern void cleanup() { }
>>
>> this is incorrect for a few reasons.  it should read:
>> +/* Dummy function as syscall() from linux_syscall_numbers.h uses cleanup() 
>> */
>> void cleanup() { }
>> -mike
>
>    Ok. I'll fix it again, recompile, and test.
>    Thanks for the review Mike :) (even though it's a bit post-mortem
> now). I do lack a bit when it comes to C coding style and that's one
> area that I want to improve upon.

Ok, new patch given Mike's review suggestion...

Fix compiler error for
testcases/kernel/syscalls/eventfd2/eventfd2_03.c noted by CAI Qian
w.r.t. the intermediate July release, as...
1. The necessary headers weren't being pulled in for waitpid.
2. gcc was complaining about -Wunused with cleanup.
3. The wrong format argument was being passed to printf.

Fix for 3 and suggestions on coding style made by Mike Frysinger.

Signed-off-by: Garrett Cooper <[email protected]>

gcoo...@orangebox /scratch/ltp-dev2/ltp $ cdiff
testcases/kernel/syscalls/eventfd2/eventfd2_03.c
Index: testcases/kernel/syscalls/eventfd2/eventfd2_03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/eventfd2/eventfd2_03.c,v
retrieving revision 1.2
diff -u -r1.2 eventfd2_03.c
--- testcases/kernel/syscalls/eventfd2/eventfd2_03.c    6 Jul 2009
14:49:18 -0000       1.2
+++ testcases/kernel/syscalls/eventfd2/eventfd2_03.c    22 Jul 2009
05:00:37 -0000
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 #include <sys/stat.h>
+#include <sys/wait.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -44,6 +45,8 @@
 #define EFD_SEMLIKE (1 << 0)
 #endif

+/* Dummy function as syscall from linux_syscall_numbers.h uses cleanup(). */
+void cleanup() { }

 static int eventfd2(int count, int flags) {
        return syscall(__NR_eventfd2, count, flags);
@@ -56,7 +59,7 @@
                perror("reading eventfd");
                exit(1);
        }
-       fprintf(stdout, "[%u] wait completed on %d: count=%llu\n",
+       fprintf(stdout, "[%u] wait completed on %d: count=%lu64\n",
                getpid(), fd, cntr);
 }

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to