diff options
author | zhaolei <zhaolei> | 2007-12-07 09:18:32 +0000 |
---|---|---|
committer | zhaolei <zhaolei> | 2007-12-07 09:18:32 +0000 |
commit | 556993413339b2db7ef51458c95bbfdcc08f7012 (patch) | |
tree | e03139e23712a7ebb61a7440a00a6a469f9e5da8 | |
parent | 47b0655b4b8e156eb20127f8c405617a165f3882 (diff) | |
download | systemtap-steved-556993413339b2db7ef51458c95bbfdcc08f7012.tar.gz systemtap-steved-556993413339b2db7ef51458c95bbfdcc08f7012.tar.xz systemtap-steved-556993413339b2db7ef51458c95bbfdcc08f7012.zip |
2007-12-7 Zhaolei <zhaolei@cn.fujitsu.com>
From Bai Weidong <baiwd@cn.fujitsu.com>
* aux_syscalls.stp (__sem_flags): Add the missed mode display,
Fix calculation error when string is empty.
-rw-r--r-- | tapset/ChangeLog | 6 | ||||
-rw-r--r-- | tapset/aux_syscalls.stp | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 49ccfbfa..3a75beba 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,9 @@ +2007-12-7 Zhaolei <zhaolei@cn.fujitsu.com> + + From Bai Weidong <baiwd@cn.fujitsu.com> + * aux_syscalls.stp (__sem_flags): Add the missed mode display, + Fix calculation error when string is empty. + 2007-11-21 Zhaolei <zhaolei@cn.fujitsu.com> From Bai Weidong <baiwd@cn.fujitsu.com> diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index e8823190..135ea98f 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; %} |