From 556993413339b2db7ef51458c95bbfdcc08f7012 Mon Sep 17 00:00:00 2001 From: zhaolei Date: Fri, 7 Dec 2007 09:18:32 +0000 Subject: [PATCH] 2007-12-7 Zhaolei From Bai Weidong * aux_syscalls.stp (__sem_flags): Add the missed mode display, Fix calculation error when string is empty. --- tapset/ChangeLog | 6 ++++++ tapset/aux_syscalls.stp | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 49ccfbfaf..3a75beba2 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,9 @@ +2007-12-7 Zhaolei + + From Bai Weidong + * aux_syscalls.stp (__sem_flags): Add the missed mode display, + Fix calculation error when string is empty. + 2007-11-21 Zhaolei From Bai Weidong diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index e8823190a..135ea98ff 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -382,13 +382,19 @@ function __sem_flags:string(semflg:long) %{ /* pure */ long semflg = THIS->semflg; char *str = THIS->__retvalue; + int mode = semflg & S_IRWXUGO; + int len; + if (mode) + snprintf(str, MAXSTRINGLEN, "%#o|", mode); if (semflg & IPC_CREAT) strlcat(str, "IPC_CREAT|", MAXSTRINGLEN); if (semflg & IPC_EXCL) strlcat(str, "IPC_EXCL|", MAXSTRINGLEN); - str[strlen(str)-1] = 0; + len = strlen(str); + if (len) + str[len-1] = 0; %} -- 2.43.5