Univention Bugzilla – Attachment 3280 Details for
Bug 22552
Univention Debug: Init sollte den File-Deskriptor zurückgeben
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
init returns file descriptor to open logfile
return-fd.patch (text/plain), 3.19 KB, created by
Andreas Büsching
on 2011-05-17 17:28:40 CEST
(
hide
)
Description:
init returns file descriptor to open logfile
Filename:
MIME Type:
Creator:
Andreas Büsching
Created:
2011-05-17 17:28:40 CEST
Size:
3.19 KB
patch
obsolete
>Index: python/py_debug.c >=================================================================== >--- python/py_debug.c (Revision 24235) >+++ python/py_debug.c (Arbeitskopie) >@@ -64,15 +64,23 @@ > { > char *logfile; > int flush, function; >+ FILE * fd; >+ PyObject * file; > > if (!PyArg_ParseTuple(args, "sii", &logfile, &flush, &function)) { > return NULL; > } > >- univention_debug_init(logfile, (char)flush, (char)function); >+ fd = univention_debug_init(logfile, (char)flush, (char)function); > >- Py_INCREF(Py_None); >- return Py_None; >+ if ( fd == NULL ) { >+ Py_RETURN_NONE; >+ } else { >+ >+ } >+ file = PyFile_FromFile( fd, logfile, "a+", NULL ); >+ >+ return file; > } > > static PyObject *py_univention_debug_set_level(PyObject *self, PyObject *args) >Index: debian/control >=================================================================== >--- debian/control (Revision 24235) >+++ debian/control (Arbeitskopie) >@@ -2,9 +2,8 @@ > Section: univention > Priority: optional > Maintainer: Univention GmbH <packages@univention.de> >-Standards-Version: 3.5.5 >+Standards-Version: 3.7.2 > Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libtool, python-all-dev, python-support >-XS-Python-Version: all > > Package: libunivention-debug1 > Architecture: any >Index: debian/rules >=================================================================== >--- debian/rules (Revision 24235) >+++ debian/rules (Arbeitskopie) >@@ -58,3 +58,4 @@ > > override_dh_auto_test: > [ ! -x /usr/bin/ucslint ] || /usr/bin/ucslint >+ >Index: include/univention/debug.h >=================================================================== >--- include/univention/debug.h (Revision 24235) >+++ include/univention/debug.h (Arbeitskopie) >@@ -102,7 +102,7 @@ > /** > * Initialize debugging library. > */ >-void univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function); >+FILE * univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function); > /** > * Close old logfile and re-open it. > */ >Index: lib/debug.c >=================================================================== >--- lib/debug.c (Revision 24235) >+++ lib/debug.c (Arbeitskopie) >@@ -84,7 +84,7 @@ > "( ALL ) : " > }; > >-void univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function) >+FILE * univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function) > { > int i; > time_t t; >@@ -97,7 +97,7 @@ > univention_debug_level = malloc(DEBUG_MODUL_COUNT * sizeof(int)); > if (univention_debug_level == NULL) { > fprintf(stderr, "Could not initialize univention_debug!\n"); >- return; >+ return NULL; > } > > for (i=0; i<DEBUG_MODUL_COUNT; i++) { >@@ -113,7 +113,7 @@ > free(univention_debug_level); > univention_debug_level = NULL; > fprintf(stderr, "Could not open logfile \"%s\"\n", univention_debug_filename); >- return /*1*/; >+ return NULL; > } > } > >@@ -127,6 +127,8 @@ > fflush(univention_debug_file); > > univention_debug_ready = true; >+ >+ return univention_debug_file; > } > > void univention_debug(enum uv_debug_category id, enum uv_debug_level level, const char *fmt, ...)
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 22552
: 3280