[PATCH 3/4] decode_select: Decode timeout for interrupted syscall

Dmitry V. Levin ldv at altlinux.org
Wed Jul 23 21:58:11 UTC 2008


2008-04-19  Dmitry V. Levin <ldv at altlinux.org>

	* desc.c (decode_select): Decode timeout for interrupted syscall.
	* syscall.c (trace_syscall): Fix ERESTART* decode output.
---
 strace/desc.c    |    7 +++++++
 strace/syscall.c |    8 ++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

--- a/strace/desc.c
+++ b/strace/desc.c
@@ -464,6 +464,13 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
 		unsigned int cumlen = 0;
 		char *sep = "";
 
+		if (args[4] && is_restart_error(tcp)) {
+			strcpy(outstr, "left ");
+			sprinttv(tcp, args[4], bitness, outstr + strlen(outstr));
+			tcp->auxstr = outstr;
+			return RVAL_STR;
+		}
+
 		if (syserror(tcp))
 			return 0;
 
--- a/strace/syscall.c
+++ b/strace/syscall.c
@@ -2344,16 +2344,16 @@ trace_syscall(struct tcb *tcp)
 			switch (u_error) {
 #ifdef LINUX
 			case ERESTARTSYS:
-				tprintf("= ? ERESTARTSYS (To be restarted)");
+				tprintf("= -1 ERESTARTSYS (To be restarted)");
 				break;
 			case ERESTARTNOINTR:
-				tprintf("= ? ERESTARTNOINTR (To be restarted)");
+				tprintf("= -1 ERESTARTNOINTR (To be restarted)");
 				break;
 			case ERESTARTNOHAND:
-				tprintf("= ? ERESTARTNOHAND (To be restarted)");
+				tprintf("= -1 ERESTARTNOHAND (To be restarted)");
 				break;
 			case ERESTART_RESTARTBLOCK:
-				tprintf("= ? ERESTART_RESTARTBLOCK (To be restarted)");
+				tprintf("= -1 ERESTART_RESTARTBLOCK (To be restarted)");
 				break;
 #endif /* LINUX */
 			default:


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20080724/4709872e/attachment.bin>


More information about the Strace-devel mailing list