tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Ktrace fix



In the syscal wrapper, only return values when the syscall did not
return an error.

Comments?
Index: sys/kern/kern_ktrace.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_ktrace.c,v
retrieving revision 1.158
diff -u -r1.158 kern_ktrace.c
--- sys/kern/kern_ktrace.c      1 Sep 2011 18:24:19 -0000       1.158
+++ sys/kern/kern_ktrace.c      29 Nov 2011 08:46:25 -0000
@@ -603,8 +603,8 @@
        ktp->ktr_code = code;
        ktp->ktr_eosys = 0;                     /* XXX unused */
        ktp->ktr_error = error;
-       ktp->ktr_retval = retval ? retval[0] : 0;
-       ktp->ktr_retval_1 = retval ? retval[1] : 0;
+       ktp->ktr_retval = retval && (error == 0) ? retval[0] : 0;
+       ktp->ktr_retval_1 = retval && (error == 0) ? retval[1] : 0;
 
        ktraddentry(l, kte, KTA_WAITOK);
 }


Home | Main Index | Thread Index | Old Index