summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-02-17 12:47:44 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2013-02-17 12:47:44 +0100
commit782d90f9187e290f4523efe04a6e0eacdeb68613 (patch)
tree0ad40190ec337bed051e2d42e09f0b96024d7014 /file.c
parent386b871b0ae22d19cce2d4ab9a998c37a802771a (diff)
downloadstrace-782d90f9187e290f4523efe04a6e0eacdeb68613.tar.gz
strace-782d90f9187e290f4523efe04a6e0eacdeb68613.tar.bz2
strace-782d90f9187e290f4523efe04a6e0eacdeb68613.tar.xz
Fix SEGV in lseek
I found hard way why the code was using "_whence" name. * file.c: Rename whence[] to whence_codes[]. (sys_lseek): Fix printxval() to use whence_codes[]. (sys_lseek32): Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/file.c b/file.c
index c3a826b..3a98674 100644
--- a/file.c
+++ b/file.c
@@ -516,7 +516,7 @@ sys_umask(struct tcb *tcp)
return RVAL_OCTAL;
}
-static const struct xlat whence[] = {
+static const struct xlat whence_codes[] = {
{ SEEK_SET, "SEEK_SET" },
{ SEEK_CUR, "SEEK_CUR" },
{ SEEK_END, "SEEK_END" },
@@ -544,7 +544,7 @@ sys_lseek(struct tcb *tcp)
tprintf(", %llu, ", offset);
else
tprintf(", %lld, ", offset);
- printxval(whence, whence, "SEEK_???");
+ printxval(whence_codes, whence, "SEEK_???");
}
return RVAL_LUDECIMAL;
}
@@ -564,7 +564,7 @@ sys_lseek32(struct tcb *tcp)
tprintf(", %lu, ", offset);
else
tprintf(", %ld, ", offset);
- printxval(whence, whence, "SEEK_???");
+ printxval(whence_codes, whence, "SEEK_???");
}
return RVAL_UDECIMAL;
}
@@ -584,7 +584,7 @@ sys_lseek(struct tcb *tcp)
tprintf(", %lu, ", offset);
else
tprintf(", %ld, ", offset);
- printxval(whence, whence, "SEEK_???");
+ printxval(whence_codes, whence, "SEEK_???");
}
return RVAL_UDECIMAL;
}
@@ -622,7 +622,7 @@ sys_llseek(struct tcb *tcp)
tprintf("%#lx, ", tcp->u_arg[3]);
else
tprintf("[%llu], ", off);
- printxval(whence, tcp->u_arg[4], "SEEK_???");
+ printxval(whence_codes, tcp->u_arg[4], "SEEK_???");
}
return 0;
}