packages: strace/strace-semop.patch - check umove() return value per devs s...
qboosh
qboosh at pld-linux.org
Wed Oct 7 22:24:15 CEST 2009
Author: qboosh Date: Wed Oct 7 20:24:15 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- check umove() return value per devs suggestion
---- Files affected:
packages/strace:
strace-semop.patch (1.1 -> 1.2)
---- Diffs:
================================================================
Index: packages/strace/strace-semop.patch
diff -u packages/strace/strace-semop.patch:1.1 packages/strace/strace-semop.patch:1.2
--- packages/strace/strace-semop.patch:1.1 Wed Sep 30 18:00:09 2009
+++ packages/strace/strace-semop.patch Wed Oct 7 22:24:10 2009
@@ -1,5 +1,5 @@
--- strace-4.5.18/ipc.c.orig 2007-01-15 21:25:52.000000000 +0100
-+++ strace-4.5.18/ipc.c 2009-09-30 17:48:38.080610937 +0200
++++ strace-4.5.18/ipc.c 2009-10-07 22:11:24.392613451 +0200
@@ -152,6 +152,12 @@
{ 0, NULL },
};
@@ -13,7 +13,7 @@
int sys_msgget(tcp)
struct tcb *tcp;
{
-@@ -273,14 +279,34 @@
+@@ -273,14 +279,40 @@
int sys_semop(tcp)
struct tcb *tcp;
{
@@ -27,12 +27,15 @@
+ tprintf(", %#lx {", tcp->u_arg[3]);
+ for(i = 0; i < tcp->u_arg[1]; i++) {
+ struct sembuf sb;
-+ umove(tcp, tcp->u_arg[3]+i*sizeof(struct sembuf), &sb);
+ if(i != 0)
+ tprintf(", ");
-+ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
-+ printflags(semop_flags, sb.sem_flg, "SEM_???");
-+ tprintf("}");
++ if (umove(tcp, tcp->u_arg[3]+i*sizeof(struct sembuf), &sb) < 0)
++ tprintf("{???}");
++ else {
++ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
++ printflags(semop_flags, sb.sem_flg, "SEM_???");
++ tprintf("}");
++ }
+ }
+ tprintf("}, %lu", tcp->u_arg[1]);
} else {
@@ -41,18 +44,21 @@
+ tprintf(", %#lx {", tcp->u_arg[1]);
+ for(i = 0; i < tcp->u_arg[2]; i++) {
+ struct sembuf sb;
-+ umove(tcp, tcp->u_arg[1]+i*sizeof(struct sembuf), &sb);
+ if(i != 0)
+ tprintf(", ");
-+ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
-+ printflags(semop_flags, sb.sem_flg, "SEM_???");
-+ tprintf("}");
++ if(umove(tcp, tcp->u_arg[1]+i*sizeof(struct sembuf), &sb) < 0)
++ tprintf("{???}");
++ else {
++ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
++ printflags(semop_flags, sb.sem_flg, "SEM_???");
++ tprintf("}");
++ }
+ }
+ tprintf("}, %lu", tcp->u_arg[2]);
}
}
return 0;
-@@ -290,15 +316,35 @@
+@@ -290,15 +322,41 @@
int sys_semtimedop(tcp)
struct tcb *tcp;
{
@@ -66,12 +72,15 @@
+ tprintf(", %#lx {", tcp->u_arg[3]);
+ for(i = 0; i < tcp->u_arg[1]; i++) {
+ struct sembuf sb;
-+ umove(tcp, tcp->u_arg[3]+i*sizeof(struct sembuf), &sb);
+ if(i != 0)
+ tprintf(", ");
-+ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
-+ printflags(semop_flags, sb.sem_flg, "SEM_???");
-+ tprintf("}");
++ if(umove(tcp, tcp->u_arg[3]+i*sizeof(struct sembuf), &sb) < 0)
++ tprintf("{???}");
++ else {
++ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
++ printflags(semop_flags, sb.sem_flg, "SEM_???");
++ tprintf("}");
++ }
+ }
+ tprintf("}, %lu, ", tcp->u_arg[1]);
printtv(tcp, tcp->u_arg[5]);
@@ -81,12 +90,15 @@
+ tprintf(", %#lx {", tcp->u_arg[1]);
+ for(i = 0; i < tcp->u_arg[2]; i++) {
+ struct sembuf sb;
-+ umove(tcp, tcp->u_arg[1]+i*sizeof(struct sembuf), &sb);
+ if(i != 0)
+ tprintf(", ");
-+ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
-+ printflags(semop_flags, sb.sem_flg, "SEM_???");
-+ tprintf("}");
++ if(umove(tcp, tcp->u_arg[1]+i*sizeof(struct sembuf), &sb) < 0)
++ tprintf("{???}");
++ else {
++ tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
++ printflags(semop_flags, sb.sem_flg, "SEM_???");
++ tprintf("}");
++ }
+ }
+ tprintf("}, %lu, ", tcp->u_arg[2]);
printtv(tcp, tcp->u_arg[3]);
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/strace/strace-semop.patch?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list