diff options
author | Michael Scheidell <scheidell@FreeBSD.org> | 2012-06-10 13:00:35 +0000 |
---|---|---|
committer | Michael Scheidell <scheidell@FreeBSD.org> | 2012-06-10 13:00:35 +0000 |
commit | 47631c222ed4da50e018a319443973587758505f (patch) | |
tree | 71342d926e563b8d54ed3529d5d846a30854c499 /chinese | |
parent | 416fbeb0b5d179b04208fa8af3740b42c3647eeb (diff) | |
download | ports-47631c222ed4da50e018a319443973587758505f.tar.gz ports-47631c222ed4da50e018a319443973587758505f.zip |
Notes
Diffstat (limited to 'chinese')
-rw-r--r-- | chinese/fcitx/Makefile | 12 | ||||
-rw-r--r-- | chinese/fcitx/files/patch-src_lib_fcitx-utils_utils.c | 78 |
2 files changed, 84 insertions, 6 deletions
diff --git a/chinese/fcitx/Makefile b/chinese/fcitx/Makefile index 90168ed05a95..06806f7da6a4 100644 --- a/chinese/fcitx/Makefile +++ b/chinese/fcitx/Makefile @@ -7,7 +7,7 @@ PORTNAME= fcitx PORTVERSION= 4.2.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= chinese x11 MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} DISTFILES= ${DISTNAME}${EXTRACT_SUFX} pinyin.tar.gz table.tar.gz @@ -38,11 +38,11 @@ INSTALLS_ICONS= yes OPTIONS_DEFINE= GTK2 GTK3 QT4 OPENCC TPUNC -GTK2_DESC= "Enable Gtk2 IM module" -GTK3_DESC= "Enable Gtk3 IM module" -QT4_DESC= "Enable Qt4 IM module" -OPENCC_DESC= "Enable OpenCC for Chinese Transform" -TPUNC_DESC= "Use traditional quotation marks" +GTK2_DESC= Enable Gtk2 IM module +GTK3_DESC= Enable Gtk3 IM module +QT4_DESC= Enable Qt4 IM module +OPENCC_DESC= Enable OpenCC for Chinese Transform +TPUNC_DESC= Use traditional quotation marks .include <bsd.port.options.mk> diff --git a/chinese/fcitx/files/patch-src_lib_fcitx-utils_utils.c b/chinese/fcitx/files/patch-src_lib_fcitx-utils_utils.c new file mode 100644 index 000000000000..9553c0fff65a --- /dev/null +++ b/chinese/fcitx/files/patch-src_lib_fcitx-utils_utils.c @@ -0,0 +1,78 @@ +diff --git src/lib/fcitx-utils/utils.c src/lib/fcitx-utils/utils.c +index c97ff44..473abc3 100644 +--- src/lib/fcitx-utils/utils.c ++++ src/lib/fcitx-utils/utils.c +@@ -337,19 +337,23 @@ int fcitx_utils_pid_exists(pid_t pid) + if (vm == 0) // ignore all error + return 1; + +- int cnt; +- struct kinfo_proc * kp = kvm_getprocs(vm, KERN_PROC_PID, pid, &cnt); +- if (kp == 0) +- return 1; +- int i; +- for (i = 0; i < cnt; i++) +- if (kp->ki_pid == pid) ++ int result = 1; ++ do { ++ int cnt; ++ struct kinfo_proc * kp = kvm_getprocs(vm, KERN_PROC_PID, pid, &cnt); ++ if (kp == 0) { ++ result = 1; + break; +- int result; +- if (i != cnt) +- result = 1; +- else +- result = 0; ++ } ++ int i; ++ for (i = 0; i < cnt; i++) ++ if (kp->ki_pid == pid) ++ break; ++ if (i != cnt) ++ result = 1; ++ else ++ result = 0; ++ } while (0); + kvm_close(vm); + return result; + #else +@@ -386,21 +390,24 @@ char* fcitx_utils_get_process_name() + if (vm == 0) + return strdup(""); + +- int cnt; +- int mypid = getpid(); +- struct kinfo_proc * kp = kvm_getprocs(vm, KERN_PROC_PID, mypid, &cnt); +- if ((cnt != 1) || (kp == 0)) +- return strdup(""); +- int i; +- for (i = 0; i < cnt; i++) +- if (kp->ki_pid == mypid) +- break; + char* result = NULL; +- if (i != cnt) +- result = strdup(kp->ki_comm); +- else +- result = strdup(""); ++ do { ++ int cnt; ++ int mypid = getpid(); ++ struct kinfo_proc * kp = kvm_getprocs(vm, KERN_PROC_PID, mypid, &cnt); ++ if ((cnt != 1) || (kp == 0)) { ++ break; ++ } ++ int i; ++ for (i = 0; i < cnt; i++) ++ if (kp->ki_pid == mypid) ++ break; ++ if (i != cnt) ++ result = strdup(kp->ki_comm); ++ } while (0); + kvm_close(vm); ++ if (result == NULL) ++ result = strdup(""); + return result; + #else + return strdup(""); |