From c1c62a13681b8eb7e1d43785da464ec4954e0160 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 20 Mar 2012 20:39:32 +0000 Subject: [PATCH] * syscalls.cc (lseek): Fix debug output. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/syscalls.cc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 63d4c8b36..cae901511 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2012-03-20 Corinna Vinschen + + * syscalls.cc (lseek): Fix debug output. + 2012-03-20 Christian Franke * ntdll.h (SharedUserData): Add volatile qualifier. This fixes a diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 21037fa10..80d22b232 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1344,7 +1344,10 @@ lseek64 (int fd, _off64_t pos, int dir) else res = -1; } - syscall_printf ("%R = lseek(%d, %D, %d)", res, fd, pos, dir); + /* Can't use %R here since res is 8 bytes */ + syscall_printf (res == -1 ? "%D = lseek(%d, %D, %d), errno %d" + : "%D = lseek(%d, %D, %d)", + res, fd, pos, dir, get_errno ()); return res; }