]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rather surprisingly we weren't actually calling pre_mem_write for the buffer
authorTom Hughes <tom@compton.nu>
Sat, 14 Aug 2004 12:10:49 +0000 (12:10 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 14 Aug 2004 12:10:49 +0000 (12:10 +0000)
argument to the read system call...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2583

coregrind/vg_syscalls.c

index 2e30e6877c4bf3c40ea99bbca6cef4024301ca23..687c10b8f4c7a1afea6939fe4f5395f4629af59a 100644 (file)
@@ -4182,13 +4182,14 @@ PRE(read)
    MAYBE_PRINTF("read ( %d, %p, %d )\n", arg1, arg2, arg3);
 
    if (!fd_allowed(arg1, "read", tid, False))
-      res = -VKI_EBADF;   
+      res = -VKI_EBADF;
+   else
+      SYSCALL_TRACK( pre_mem_write, tid, "read(buf)", arg2, arg3 );
 }
 
 POST(read)
 {
-   if (res > 0)
-      VG_TRACK(post_mem_write, arg2, res);
+   VG_TRACK( post_mem_write, arg2, res );
 }
 
 PRE(write)