]> granicus.if.org Git - strace/commitdiff
fcntl.c: mark F_DUPFD and F_DUPFD_CLOEXEC return code with RVAL_FD flag
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 9 Oct 2015 20:19:25 +0000 (20:19 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 26 Nov 2015 01:37:34 +0000 (01:37 +0000)
* fcntl.c (SYS_FUNC(fcntl)): Set RVAL_FD flag in the return code
for F_DUPFD and F_DUPFD_CLOEXEC operations.

fcntl.c

diff --git a/fcntl.c b/fcntl.c
index a3f73e077a16d70c76b5426bc786a32e4c03fc11..046a156ed7ae70e79369e16cc54298cc5c3fec40 100644 (file)
--- a/fcntl.c
+++ b/fcntl.c
@@ -117,10 +117,13 @@ SYS_FUNC(fcntl)
                        tprints(", ");
                        printflags(fdflags, tcp->u_arg[2], "FD_???");
                        break;
-               case F_SETOWN: case F_DUPFD:
-               case F_DUPFD_CLOEXEC:
+               case F_SETOWN:
                        tprintf(", %ld", tcp->u_arg[2]);
                        break;
+               case F_DUPFD:
+               case F_DUPFD_CLOEXEC:
+                       tprintf(", %ld", tcp->u_arg[2]);
+                       return RVAL_DECODED | RVAL_FD;
                case F_SETFL:
                        tprints(", ");
                        tprint_open_modes(tcp->u_arg[2]);