diff options
author | scheidell <scheidell@FreeBSD.org> | 2012-06-10 21:00:35 +0800 |
---|---|---|
committer | scheidell <scheidell@FreeBSD.org> | 2012-06-10 21:00:35 +0800 |
commit | 95992b23a3ecbfbf6e80a507a53bb42447951c12 (patch) | |
tree | 350f6f45b32cfdde28feb4cc8e57b0cf753d59c8 /chinese/fcitx | |
parent | 762ccf964a87e8f14de3405e595a6eb24c5ba9da (diff) | |
download | freebsd-ports-gnome-95992b23a3ecbfbf6e80a507a53bb42447951c12.tar.gz freebsd-ports-gnome-95992b23a3ecbfbf6e80a507a53bb42447951c12.tar.zst freebsd-ports-gnome-95992b23a3ecbfbf6e80a507a53bb42447951c12.zip |
- Upstream patch to fix libkvm fd leaking
- Bump PORTREVISION
PR: ports/168907
Submitted by: Zhihao Yuan <lichray@gmail.com> (maintainer)
Obtained from: http://paste.opensuse.org/23129601
Diffstat (limited to 'chinese/fcitx')
-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(""); |