Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 223211 Details for
Bug 286191
app-eselect/eselect-python: python-wrapper sometimes breaks init scripts using start-stop-daemon with Python scripts
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for dev-lang/python:2.6
python-2.6-process_data.patch (text/plain), 1.78 KB, created by
Arfrever Frehtes Taifersar Arahesis (RETIRED)
on 2010-03-11 20:29:30 UTC
(
hide
)
Description:
Patch for dev-lang/python:2.6
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis (RETIRED)
Created:
2010-03-11 20:29:30 UTC
Size:
1.78 KB
patch
obsolete
>--- Modules/main.c >+++ Modules/main.c >@@ -452,7 +452,11 @@ > filename = argv[_PyOS_optind]; > > #else >- filename = argv[_PyOS_optind]; >+ char *target_script_name = getenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH"); >+ if (target_script_name) >+ filename = target_script_name; >+ else >+ filename = argv[_PyOS_optind]; > #endif > } > >--- Modules/python.c >+++ Modules/python.c >@@ -6,9 +6,19 @@ > #include <floatingpoint.h> > #endif > >+#ifdef __linux__ >+#include <linux/prctl.h> >+#include <sys/prctl.h> >+#endif >+ > int > main(int argc, char **argv) > { >+ if (getenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION")) { >+ printf("GENTOO_PYTHON_TARGET_SCRIPT_PATH supported\n"); >+ return 0; >+ } >+ > /* 754 requires that FP exceptions run in "no stop" mode by default, > * and until C vendors implement C99's ways to control FP exceptions, > * Python requires non-stop mode. Alas, some platforms enable FP >@@ -20,5 +30,12 @@ > m = fpgetmask(); > fpsetmask(m & ~FP_X_OFL); > #endif >+ >+#ifdef __linux__ >+ char *process_name = getenv("GENTOO_PYTHON_PROCESS_NAME"); >+ if (process_name) >+ prctl(PR_SET_NAME, process_name); >+#endif >+ > return Py_Main(argc, argv); > } >--- Python/sysmodule.c >+++ Python/sysmodule.c >@@ -1490,6 +1490,7 @@ > makeargvobject(int argc, char **argv) > { > PyObject *av; >+ char *wrapper_script_name = getenv("GENTOO_PYTHON_WRAPPER_SCRIPT_PATH"); > if (argc <= 0 || argv == NULL) { > /* Ensure at least one (empty) argument is seen */ > static char *empty_argv[1] = {""}; >@@ -1514,7 +1515,11 @@ > } else > v = PyString_FromString(argv[i]); > #else >- PyObject *v = PyString_FromString(argv[i]); >+ PyObject *v; >+ if (i == 0 && wrapper_script_name != NULL) >+ v = PyString_FromString(wrapper_script_name); >+ else >+ v = PyString_FromString(argv[i]); > #endif > if (v == NULL) { > Py_DECREF(av);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 286191
:
205104
|
213083
|
213125
|
220639
|
220641
|
221107
|
222473
|
222883
|
222885
|
222887
|
223211
|
223213