Re: [PATCH] bsd: Add support for -novtswitch.
On Fri, May 13, 2011 at 04:57:13PM +0200, Cyril Brulebois wrote: VT switching back to the initial VT is possible in the following case: #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) Make it possible to prevent that from happening if -novtswitch was passed, which should make the life of display manager developers easier, especially when it comes to handling multiple users. X.Org Bug 37174 http://bugs.freedesktop.org/show_bug.cgi?id=37174 Signed-off-by: Cyril Brulebois k...@debian.org PCVT (and wscons in PCVT emulation mode) doesn't support having both a getty process and the X server attached to the same VT. Running X -noswitchvt will thus not work. At least on Net/OpenBSD, when using a display manager, we always specify a free VT to use on X's command line, forcing a VT switch to avoid this. I don't know know how syscons (FreeBSD) behaves when 2 processes are attached to the same VT, and I also don't see what are the extra VT switches that the PR is referring too. So may be syscons has some specific behaviour that I'm not aware of ? --- hw/xfree86/os-support/bsd/bsd_init.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) Patch tested on a GNU/kFreeBSD VM, on top of 1.10.2rc1. Applies on top of master too, but not tested against it. diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c index 123eb17..77667bb 100644 --- a/hw/xfree86/os-support/bsd/bsd_init.c +++ b/hw/xfree86/os-support/bsd/bsd_init.c @@ -41,6 +41,7 @@ #include errno.h static Bool KeepTty = FALSE; +static Bool VTSwitch = TRUE; static int devConsoleFd = -1; #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) static int VTnum = -1; @@ -680,7 +681,7 @@ xf86CloseConsole() strerror(errno)); } #endif - if (initialVT != -1) + if ((initialVT != -1) VTSwitch) ioctl(xf86Info.consoleFd, VT_ACTIVATE, initialVT); break; #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ @@ -723,6 +724,11 @@ xf86ProcessArgument(int argc, char *argv[], int i) return 1; } #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) + if (!strcmp(argv[i], -novtswitch)) + { + VTSwitch = FALSE; + return 1; + } if (!strcmp(argv[i], -sharevts)) { ShareVTs = TRUE; -- 1.7.5.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel -- Matthieu Herrb ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] bsd: Add support for -novtswitch.
On Sat, May 14, 2011 at 12:53:48 +0200, Matthieu Herrb wrote: On Fri, May 13, 2011 at 04:57:13PM +0200, Cyril Brulebois wrote: VT switching back to the initial VT is possible in the following case: #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) Make it possible to prevent that from happening if -novtswitch was passed, which should make the life of display manager developers easier, especially when it comes to handling multiple users. X.Org Bug 37174 http://bugs.freedesktop.org/show_bug.cgi?id=37174 Signed-off-by: Cyril Brulebois k...@debian.org PCVT (and wscons in PCVT emulation mode) doesn't support having both a getty process and the X server attached to the same VT. Running X -noswitchvt will thus not work. At least on Net/OpenBSD, when using a display manager, we always specify a free VT to use on X's command line, forcing a VT switch to avoid this. I don't know know how syscons (FreeBSD) behaves when 2 processes are attached to the same VT, and I also don't see what are the extra VT switches that the PR is referring too. So may be syscons has some specific behaviour that I'm not aware of ? This is not about running two processes on the same VT. It's about allowing gdm to control when VT switches happen, by not switching back to whatever VT we started from on regen and exit. Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] bsd: Add support for -novtswitch.
On Fri, May 13, 2011 at 16:57:13 +0200, Cyril Brulebois wrote: VT switching back to the initial VT is possible in the following case: #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) Make it possible to prevent that from happening if -novtswitch was passed, which should make the life of display manager developers easier, especially when it comes to handling multiple users. X.Org Bug 37174 http://bugs.freedesktop.org/show_bug.cgi?id=37174 Signed-off-by: Cyril Brulebois k...@debian.org --- hw/xfree86/os-support/bsd/bsd_init.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) Patch tested on a GNU/kFreeBSD VM, on top of 1.10.2rc1. Applies on top of master too, but not tested against it. Compared to the Linux path, this is missing the regen case (serverGeneration 1 in OpenConsole()), and the Xorg -help text in xf86UseMsg(). Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver] doc: add external doc references support to Xserver-DTrace
This makefile is used to build the 60+ docbooks in xorg. Dtrace is a user document and should be located under doc subdir. This user document can now refer to external user/specs docs or can be referred to by such documnets. Reviewed-by Jeremy Huddleston jerem...@apple.com Signed-off-by: Gaetan Nadon mems...@videotron.ca --- Rebased due to the added Xinput.xml configure.ac|5 +- doc/Makefile.am |2 +- doc/dtrace/.gitignore |5 ++ doc/dtrace/Makefile.am | 17 ++ doc/{xml = }/dtrace/Xserver-DTrace.xml |1 - doc/xml/Makefile.am |1 - doc/xml/dtrace/.gitignore |3 - doc/xml/dtrace/Makefile.am | 36 docbook.am | 96 +++ 9 files changed, 122 insertions(+), 44 deletions(-) create mode 100644 doc/dtrace/.gitignore create mode 100644 doc/dtrace/Makefile.am rename doc/{xml = }/dtrace/Xserver-DTrace.xml (99%) delete mode 100644 doc/xml/dtrace/.gitignore delete mode 100644 doc/xml/dtrace/Makefile.am create mode 100644 docbook.am diff --git a/configure.ac b/configure.ac index e23274c..ba6bacb 100644 --- a/configure.ac +++ b/configure.ac @@ -38,11 +38,12 @@ m4_ifndef([XORG_MACROS_VERSION], XORG_MACROS_VERSION(1.13) XORG_DEFAULT_OPTIONS XORG_WITH_DOXYGEN(1.6.1) -XORG_CHECK_SGML_DOCTOOLS(1.5) +XORG_CHECK_SGML_DOCTOOLS(1.7) XORG_ENABLE_DOCS XORG_ENABLE_DEVEL_DOCS XORG_WITH_XMLTO(0.0.20) XORG_WITH_FOP +XORG_WITH_XSLTPROC XORG_ENABLE_UNIT_TESTS XORG_LD_WRAP @@ -2151,8 +2152,8 @@ damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile +doc/dtrace/Makefile doc/xml/Makefile -doc/xml/dtrace/Makefile doc/xml/xserver.ent man/Makefile fb/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index b9015bc..e8634fd 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = xml +SUBDIRS = dtrace xml dist_noinst_DATA = smartsched diff --git a/doc/dtrace/.gitignore b/doc/dtrace/.gitignore new file mode 100644 index 000..0d40e0d --- /dev/null +++ b/doc/dtrace/.gitignore @@ -0,0 +1,5 @@ +*.html +*.pdf +*.ps +*.txt +*.db diff --git a/doc/dtrace/Makefile.am b/doc/dtrace/Makefile.am new file mode 100644 index 000..aaf5a12 --- /dev/null +++ b/doc/dtrace/Makefile.am @@ -0,0 +1,17 @@ + +if ENABLE_DOCS +if HAVE_XMLTO +if XSERVER_DTRACE + +# Main DocBook/XML files (DOCTYPE book) +docbook = Xserver-DTrace.xml + +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir) + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am + +endif XSERVER_DTRACE +endif HAVE_XMLTO +endif ENABLE_DOCS diff --git a/doc/xml/dtrace/Xserver-DTrace.xml b/doc/dtrace/Xserver-DTrace.xml similarity index 99% rename from doc/xml/dtrace/Xserver-DTrace.xml rename to doc/dtrace/Xserver-DTrace.xml index 290f0d3..69cd30e 100644 --- a/doc/xml/dtrace/Xserver-DTrace.xml +++ b/doc/dtrace/Xserver-DTrace.xml @@ -576,4 +576,3 @@ Xserver$1:::client-disconnect /sect1 /article - diff --git a/doc/xml/Makefile.am b/doc/xml/Makefile.am index b793e7b..b35ceec 100644 --- a/doc/xml/Makefile.am +++ b/doc/xml/Makefile.am @@ -21,7 +21,6 @@ # DEALINGS IN THE SOFTWARE. # -SUBDIRS = dtrace doc_sources = Xserver-spec.xml Xinput.xml # Developer's documentation is not installed diff --git a/doc/xml/dtrace/.gitignore b/doc/xml/dtrace/.gitignore deleted file mode 100644 index e2a21d1..000 --- a/doc/xml/dtrace/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Xserver-DTrace.html -Xserver-DTrace.pdf -Xserver-DTrace.txt diff --git a/doc/xml/dtrace/Makefile.am b/doc/xml/dtrace/Makefile.am deleted file mode 100644 index 1a5ad15..000 --- a/doc/xml/dtrace/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the Software), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN
[PATCH xserver] doc: relocate xserver.ent in the package root directory
This is the appropriate location for reusable configuration and/or makefile artifacts as opposed to picking one of the subdirs where it is used. It shields them from future doc reorg as every subdir will refer to the root package which never changes location. Reviewed-by Jeremy Huddleston jerem...@apple.com Signed-off-by: Gaetan Nadon mems...@videotron.ca --- .gitignore |1 + configure.ac |2 +- devbook.am |2 +- doc/xml/.gitignore |2 -- doc/xml/xmlrules.in |2 +- docbook.am |2 +- doc/xml/xserver.ent.in = xserver.ent.in |0 7 files changed, 5 insertions(+), 6 deletions(-) rename doc/xml/xserver.ent.in = xserver.ent.in (100%) diff --git a/.gitignore b/.gitignore index 72390a0..94a12fd 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,4 @@ core # doltcompile doltlibtool +xserver.ent diff --git a/configure.ac b/configure.ac index ba6bacb..9d0854f 100644 --- a/configure.ac +++ b/configure.ac @@ -2154,7 +2154,6 @@ dix/Makefile doc/Makefile doc/dtrace/Makefile doc/xml/Makefile -doc/xml/xserver.ent man/Makefile fb/Makefile record/Makefile @@ -2244,5 +2243,6 @@ hw/kdrive/linux/Makefile hw/kdrive/src/Makefile test/Makefile test/xi2/Makefile +xserver.ent xorg-server.pc ]) diff --git a/devbook.am b/devbook.am index dbc9d8a..4e23bb7 100644 --- a/devbook.am +++ b/devbook.am @@ -30,7 +30,7 @@ if HAVE_STYLESHEETS # The location where all cross reference databases are installed XMLTO_FLAGS = \ --searchpath $(XORG_SGML_PATH)/X11\ - --searchpath $(abs_top_builddir)/doc/xml \ + --searchpath $(abs_top_builddir) \ --stringparam current.docid=$(:.xml=) XMLTO_XHTML_FLAGS = \ diff --git a/doc/xml/.gitignore b/doc/xml/.gitignore index 4961738..3f0ed13 100644 --- a/doc/xml/.gitignore +++ b/doc/xml/.gitignore @@ -1,5 +1,3 @@ -# Add Override for this directory and its subdirectories -xserver.ent Xserver-spec.html Xserver-spec.pdf Xserver-spec.txt diff --git a/doc/xml/xmlrules.in b/doc/xml/xmlrules.in index f6a2e4f..8b22761 100644 --- a/doc/xml/xmlrules.in +++ b/doc/xml/xmlrules.in @@ -27,7 +27,7 @@ # It is included by xmlrules-noinst for non installable developer's documentation # If the server version or release date changes, autogen make -XML_ENT_DIR = $(abs_top_builddir)/doc/xml +XML_ENT_DIR = $(abs_top_builddir) SUFFIXES = .xml .txt .html .pdf XMLTO_FLAGS = --searchpath $(XML_ENT_DIR) diff --git a/docbook.am b/docbook.am index 50a542e..7ab7a00 100644 --- a/docbook.am +++ b/docbook.am @@ -32,7 +32,7 @@ sgmldbsdir = $(XORG_SGML_PATH)/X11/dbs masterdb = $(sgmldbsdir)/masterdb$(suffix $@).xml XMLTO_FLAGS = \ --searchpath $(XORG_SGML_PATH)/X11\ - --searchpath $(abs_top_builddir)/doc/xml \ + --searchpath $(abs_top_builddir) \ --stringparam target.database.document=$(masterdb) \ --stringparam current.docid=$(:.xml=)\ --stringparam collect.xref.targets=no diff --git a/doc/xml/xserver.ent.in b/xserver.ent.in similarity index 100% rename from doc/xml/xserver.ent.in rename to xserver.ent.in -- 1.6.0.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver] doc: use devbook.am for developers documentation
Relocate the docs under the doc subdir. Remove redundant xml subdir. The xmlrules set of makefiles are no longer used. Reviewed-by Jeremy Huddleston jerem...@apple.com Signed-off-by: Gaetan Nadon mems...@videotron.ca --- Rebased due to the added Xinput.xml configure.ac |1 - doc/.gitignore |4 +++ doc/Makefile.am| 16 - doc/{xml = }/Xinput.xml |0 doc/{xml = }/Xserver-spec.xml |0 doc/xml/.gitignore |3 -- doc/xml/Makefile.am| 29 doc/xml/xmlrules-inst.in | 23 --- doc/xml/xmlrules-noinst.in | 22 -- doc/xml/xmlrules.in| 47 10 files changed, 18 insertions(+), 127 deletions(-) create mode 100644 doc/.gitignore rename doc/{xml = }/Xinput.xml (100%) rename doc/{xml = }/Xserver-spec.xml (100%) delete mode 100644 doc/xml/.gitignore delete mode 100644 doc/xml/Makefile.am delete mode 100644 doc/xml/xmlrules-inst.in delete mode 100644 doc/xml/xmlrules-noinst.in delete mode 100644 doc/xml/xmlrules.in diff --git a/configure.ac b/configure.ac index 9d0854f..655c0e4 100644 --- a/configure.ac +++ b/configure.ac @@ -2153,7 +2153,6 @@ dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile -doc/xml/Makefile man/Makefile fb/Makefile record/Makefile diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000..2ee2ac5 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,4 @@ +*.html +*.pdf +*.ps +*.txt diff --git a/doc/Makefile.am b/doc/Makefile.am index e8634fd..e6974fe 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,15 @@ -SUBDIRS = dtrace xml +SUBDIRS = dtrace -dist_noinst_DATA = smartsched +if ENABLE_DEVEL_DOCS +if HAVE_XMLTO + +# Main DocBook/XML files (DOCTYPE book) +docbook = Xserver-spec.xml Xinput.xml + +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/devbook.am + +endif HAVE_XMLTO +endif ENABLE_DEVEL_DOCS + +EXTRA_DIST = smartsched diff --git a/doc/xml/Xinput.xml b/doc/Xinput.xml similarity index 100% rename from doc/xml/Xinput.xml rename to doc/Xinput.xml diff --git a/doc/xml/Xserver-spec.xml b/doc/Xserver-spec.xml similarity index 100% rename from doc/xml/Xserver-spec.xml rename to doc/Xserver-spec.xml diff --git a/doc/xml/.gitignore b/doc/xml/.gitignore deleted file mode 100644 index 3f0ed13..000 --- a/doc/xml/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Xserver-spec.html -Xserver-spec.pdf -Xserver-spec.txt diff --git a/doc/xml/Makefile.am b/doc/xml/Makefile.am deleted file mode 100644 index b35ceec..000 --- a/doc/xml/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the Software), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# - -doc_sources = Xserver-spec.xml Xinput.xml - -# Developer's documentation is not installed -if ENABLE_DEVEL_DOCS -include $(top_srcdir)/doc/xml/xmlrules-noinst.in -endif diff --git a/doc/xml/xmlrules-inst.in b/doc/xml/xmlrules-inst.in deleted file mode 100644 index 9b90278..000 --- a/doc/xml/xmlrules-inst.in +++ /dev/null @@ -1,23 +0,0 @@ - -# The doc_sources variable contains one or more DocBook/XML source file. -# The generated documents will be installed in $(docdir), -# The DocBook/XML files will always be included in the tarball - -dist_doc_DATA = $(doc_sources) - -if HAVE_XMLTO -doc_DATA = $(doc_sources:.xml=.html) - -if HAVE_FOP -doc_DATA += $(doc_sources:.xml=.pdf) -endif - -if HAVE_XMLTO_TEXT -doc_DATA += $(doc_sources:.xml=.txt) -endif - -CLEANFILES = $(doc_DATA) -include $(top_srcdir)/doc/xml/xmlrules.in - -endif HAVE_XMLTO - diff --git a/doc/xml/xmlrules-noinst.in b/doc/xml/xmlrules-noinst.in deleted file mode 100644 index 0333652..000 --- a/doc/xml/xmlrules-noinst.in +++ /dev/null @@ -1,22 +0,0 @@ - -# The doc_sources
Re: [PATCH xserver 7/9] doc: add external doc references support to Xserver-DTrace
On Fri, 2011-05-13 at 14:09 -0700, Keith Packard wrote: On Thu, 28 Apr 2011 21:16:14 -0400, Gaetan Nadon mems...@videotron.ca wrote: This makefile is used to build the 60+ docbooks in xorg. Dtrace is a user document and should be located under doc subdir. This user document can now refer to external user/specs docs or can be referred to by such documnets. This one doesn't apply anymore. A new doc was added in the Makefile which needs to be relocated. I reposted 7,8 and 9. signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xdm 1/5] Fix potential memory leak in allocation failure cleanup path
Error: Memory leak (CWE 401) Memory leak of pointer 'newargv' allocated with realloc(((i8*)argv), ((i * 4) + 8)) at line 239 of /export/alanc/X.Org/git/app/xdm/xdm/util.c in function 'parseArgs'. 'newargv' allocated at line 231 with realloc(((i8*)argv), ((i * 4) + 8)). newargv leaks when newargv != 0 at line 234 and save == 0 at line 234. [This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- xdm/util.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/xdm/util.c b/xdm/util.c index 65b3b85..572b9c5 100644 --- a/xdm/util.c +++ b/xdm/util.c @@ -234,6 +234,7 @@ parseArgs (char **argv, char *string) if (!newargv || !save) { LogOutOfMem (parseArgs); free ((char *) argv); + free (newargv); if (save) free (save); return NULL; -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xdm 2/5] Stop checking for NULL before calling free()
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- chooser/chooser.c |3 +-- xdm/access.c | 15 +-- xdm/auth.c|9 +++-- xdm/dm.c |3 +-- xdm/dpylist.c | 50 -- xdm/krb5auth.c|3 +-- xdm/server.c |3 +-- xdm/socket.c |3 +-- xdm/util.c|3 +-- xdm/xdmauth.c |6 ++ xdm/xdmcp.c |4 ++-- 11 files changed, 42 insertions(+), 60 deletions(-) diff --git a/chooser/chooser.c b/chooser/chooser.c index d3d08ea..01201b7 100644 --- a/chooser/chooser.c +++ b/chooser/chooser.c @@ -312,8 +312,7 @@ RebuildTable (int size) qsort (newTable, size, sizeof (char *), HostnameCompare); } XawListChange (list, newTable, size, 0, TRUE); -if (NameTable) - free ((char *) NameTable); +free ((char *) NameTable); NameTable = newTable; NameTableSize = size; } diff --git a/xdm/access.c b/xdm/access.c index eae5286..ceace37 100644 --- a/xdm/access.c +++ b/xdm/access.c @@ -784,8 +784,7 @@ int ForEachMatchingIndirectHost ( } break; } -if (clientName) - free (clientName); +free (clientName); return haveLocalhost; } @@ -823,14 +822,12 @@ int UseChooser ( if (d-notAllowed) break; if (d-chooser !IndirectChoice (clientAddress, connectionType)) { - if (clientName) - free (clientName); + free (clientName); return 1; } break; } -if (clientName) - free (clientName); +free (clientName); return 0; } @@ -879,8 +876,7 @@ void ForEachChooserHost ( } break; } -if (clientName) - free (clientName); +free (clientName); if (haveLocalhost) (*function) (connectionType, getLocalAddress(), closure); } @@ -928,8 +924,7 @@ int AcceptableDisplayAddress ( } break; } -if (clientName) - free (clientName); +free (clientName); return (d != 0) (d-notAllowed == 0) (type == BROADCAST_QUERY ? d-notBroadcast == 0 : 1); } diff --git a/xdm/auth.c b/xdm/auth.c index 63cd15e..ec3a1cc 100644 --- a/xdm/auth.c +++ b/xdm/auth.c @@ -505,8 +505,7 @@ SetLocalAuthorization (struct display *d) for (i = 0; d-authNames[i]; i++) ; d-authNameNum = i; -if (d-authNameLens) - free ((char *) d-authNameLens); +free ((char *) d-authNameLens); d-authNameLens = (unsigned short *) malloc (d-authNameNum * sizeof (unsigned short)); if (!d-authNameLens) @@ -663,10 +662,8 @@ doneAddrs (void) struct addrList *a, *n; for (a = addrs; a; a = n) { n = a-next; - if (a-address) - free (a-address); - if (a-number) - free (a-number); + free (a-address); + free (a-number); free ((char *) a); } } diff --git a/xdm/dm.c b/xdm/dm.c index 9d0f0e8..cd0ee25 100644 --- a/xdm/dm.c +++ b/xdm/dm.c @@ -733,8 +733,7 @@ SetWindowPath(struct display *d) } else { asprintf(newwindowpath, %s:%lu, windowpath, num); } - if (d-windowPath) - free(d-windowPath); + free(d-windowPath); d-windowPath = newwindowpath; } diff --git a/xdm/dpylist.c b/xdm/dpylist.c index dccd679..148f524 100644 --- a/xdm/dpylist.c +++ b/xdm/dpylist.c @@ -118,8 +118,6 @@ FindDisplayByAddress (XdmcpNetaddr addr, int addrlen, CARD16 displayNumber) #endif /* XDMCP */ -#define IfFree(x) if (x) free ((char *) x) - void RemoveDisplay (struct display *old) { @@ -134,43 +132,43 @@ RemoveDisplay (struct display *old) p-next = d-next; else displays = d-next; - IfFree (d-name); - IfFree (d-class); + free (d-name); + free (d-class); for (x = d-argv; x *x; x++) - IfFree (*x); - IfFree (d-argv); - IfFree (d-resources); - IfFree (d-xrdb); - IfFree (d-setup); - IfFree (d-startup); - IfFree (d-reset); - IfFree (d-session); - IfFree (d-userPath); - IfFree (d-systemPath); - IfFree (d-systemShell); - IfFree (d-failsafeClient); - IfFree (d-chooser); + free (*x); + free (d-argv); + free (d-resources); + free (d-xrdb); + free (d-setup); + free (d-startup); + free (d-reset); + free (d-session); + free (d-userPath); + free (d-systemPath); + free (d-systemShell); + free (d-failsafeClient); + free (d-chooser); if (d-authorizations) { for (i = 0; i d-authNum; i++) XauDisposeAuth
[PATCH:xdm 3/5] Stop casting free() arguments to (char *)
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- chooser/chooser.c | 12 ++-- xdm/access.c | 18 +- xdm/auth.c| 14 +++--- xdm/choose.c | 12 ++-- xdm/dpylist.c |8 xdm/file.c|4 ++-- xdm/krb5auth.c|6 +++--- xdm/mitauth.c | 12 ++-- xdm/protodpy.c| 10 +- xdm/rpcauth.c |6 +++--- xdm/server.c |2 +- xdm/util.c|4 ++-- xdm/xdmauth.c | 18 +- xdm/xdmcp.c | 12 ++-- 14 files changed, 69 insertions(+), 69 deletions(-) diff --git a/chooser/chooser.c b/chooser/chooser.c index 01201b7..6033fb4 100644 --- a/chooser/chooser.c +++ b/chooser/chooser.c @@ -312,7 +312,7 @@ RebuildTable (int size) qsort (newTable, size, sizeof (char *), HostnameCompare); } XawListChange (list, newTable, size, 0, TRUE); -free ((char *) NameTable); +free (NameTable); NameTable = newTable; NameTableSize = size; } @@ -388,8 +388,8 @@ AddHostname (ARRAY8Ptr hostname, ARRAY8Ptr status, struct sockaddr *addr, int wi } if (!XdmcpAllocARRAY8 (new-hostaddr, hostAddr.length)) { - free ((char *) new-fullname); - free ((char *) new); + free (new-fullname); + free (new); return 0; } memmove( new-hostaddr.data, hostAddr.data, hostAddr.length); @@ -436,8 +436,8 @@ DisposeHostname (HostName *host) XdmcpDisposeARRAY8 (host-hostname); XdmcpDisposeARRAY8 (host-hostaddr); XdmcpDisposeARRAY8 (host-status); -free ((char *) host-fullname); -free ((char *) host); +free (host-fullname); +free (host); } #if 0 @@ -551,7 +551,7 @@ RegisterHostaddr (struct sockaddr *addr, int len, xdmOpCode type) host-addr = (struct sockaddr *) malloc (len); if (!host-addr) { - free ((char *) host); + free (host); return; } memmove( (char *) host-addr, (char *) addr, len); diff --git a/xdm/access.c b/xdm/access.c index ceace37..8db64b3 100644 --- a/xdm/access.c +++ b/xdm/access.c @@ -187,7 +187,7 @@ FreeHostEntry (HostEntry *h) case HOST_CHOOSER: break; } -free ((char *) h); +free (h); } static void @@ -212,7 +212,7 @@ FreeDisplayEntry (DisplayEntry *d) next = h-next; FreeHostEntry (h); } -free ((char *) d); +free (d); } static void @@ -310,7 +310,7 @@ tryagain: h-type = HOST_ALIAS; h-entry.aliasName = strdup (hostOrAlias); if (!h-entry.aliasName) { - free ((char *) h); + free (h); return NULL; } } @@ -371,7 +371,7 @@ tryagain: { Debug (No such host %s\n, hostOrAlias); LogError (Access file \%s\, host \%s\ not found\n, accessFile, hostOrAlias); - free ((char *) h); + free (h); # if defined(IPv6) defined(AF_INET6) if (ai) freeaddrinfo(ai); @@ -381,7 +381,7 @@ tryagain: if (!XdmcpAllocARRAY8 (h-entry.hostAddress, addr_length)) { LogOutOfMem (ReadHostEntry\n); - free ((char *) h); + free (h); # if defined(IPv6) defined(AF_INET6) if (ai) freeaddrinfo(ai); @@ -432,7 +432,7 @@ tryagain: d-entry.aliasName = strdup (displayOrAlias); if (!d-entry.aliasName) { - free ((char *) d); + free (d); return NULL; } } @@ -453,7 +453,7 @@ tryagain: d-entry.displayPattern = strdup (displayOrAlias); if (!d-entry.displayPattern) { - free ((char *) d); + free (d); return NULL; } } @@ -490,7 +490,7 @@ tryagain: if (addr == NULL) { LogError (Access file %s, display %s unknown\n, accessFile, displayOrAlias); - free ((char *) d); + free (d); # if defined(IPv6) defined(AF_INET6) if (ai) freeaddrinfo(ai); @@ -501,7 +501,7 @@ tryagain: display = d-entry.displayAddress; if (!XdmcpAllocARRAY8 (display-clientAddress, addr_length)) { - free ((char *) d); + free (d); # if defined(IPv6) defined(AF_INET6) if (ai) freeaddrinfo(ai); diff --git a/xdm/auth.c b/xdm/auth.c index ec3a1cc..10791d2 100644 --- a/xdm/auth.c +++ b/xdm/auth.c @@ -496,7 +496,7 @@ SetLocalAuthorization (struct display *d) { for (i = 0; i d-authNum; i++) XauDisposeAuth (d-authorizations[i]); - free ((char *) d-authorizations); + free (d-authorizations); d-authorizations = (Xauth **) NULL; d-authNum = 0; } @@ -505,7 +505,7 @@ SetLocalAuthorization (struct display *d) for (i = 0; d-authNames[i]; i++) ;
[PATCH:xdm 4/5] Stop casting return values of malloc and friends
It's not needed on modern mallocs that return void *, and can hide missing prototype errors that cause the compiler to assume int is returned (a bad thing to assume in 64-bit builds). Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- chooser/chooser.c |8 xdm/access.c |4 ++-- xdm/auth.c|7 +++ xdm/choose.c |4 ++-- xdm/dpylist.c |2 +- xdm/file.c|7 +++ xdm/krb5auth.c|7 +++ xdm/mitauth.c |6 +++--- xdm/policy.c |2 +- xdm/protodpy.c|4 ++-- xdm/resource.c|2 +- xdm/rpcauth.c |6 +++--- xdm/server.c |2 +- xdm/session.c |2 +- xdm/util.c|8 xdm/xdmauth.c |8 xdm/xdmcp.c |4 ++-- 17 files changed, 40 insertions(+), 43 deletions(-) diff --git a/chooser/chooser.c b/chooser/chooser.c index 6033fb4..dc1b89a 100644 --- a/chooser/chooser.c +++ b/chooser/chooser.c @@ -304,7 +304,7 @@ RebuildTable (int size) if (size) { - newTable = (char **) malloc (size * sizeof (char *)); + newTable = malloc (size * sizeof (char *)); if (!newTable) return; for (names = hostNamedb, i = 0; names; names = names-next, i++) @@ -360,7 +360,7 @@ AddHostname (ARRAY8Ptr hostname, ARRAY8Ptr status, struct sockaddr *addr, int wi } if (!*names) { - new = (HostName *) malloc (sizeof (HostName)); + new = malloc (sizeof (HostName)); if (!new) return 0; if (hostname-length) @@ -545,10 +545,10 @@ RegisterHostaddr (struct sockaddr *addr, int len, xdmOpCode type) { HostAddr *host, **prev; -host = (HostAddr *) malloc (sizeof (HostAddr)); +host = malloc (sizeof (HostAddr)); if (!host) return; -host-addr = (struct sockaddr *) malloc (len); +host-addr = malloc (len); if (!host-addr) { free (host); diff --git a/xdm/access.c b/xdm/access.c index 8db64b3..d0850ad 100644 --- a/xdm/access.c +++ b/xdm/access.c @@ -303,7 +303,7 @@ tryagain: hostOrAlias = ReadWord (file, TRUE); if (!hostOrAlias) return NULL; -h = (HostEntry *) malloc (sizeof (DisplayEntry)); +h = malloc (sizeof (DisplayEntry)); h-hopCount = 1; if (*hostOrAlias == ALIAS_CHARACTER) { @@ -422,7 +422,7 @@ tryagain: displayOrAlias = ReadWord (file, FALSE); if (!displayOrAlias) return NULL; -d = (DisplayEntry *) malloc (sizeof (DisplayEntry)); +d = malloc (sizeof (DisplayEntry)); d-notAllowed = 0; d-notBroadcast = 0; d-chooser = 0; diff --git a/xdm/auth.c b/xdm/auth.c index 10791d2..8b6e1ec 100644 --- a/xdm/auth.c +++ b/xdm/auth.c @@ -506,13 +506,12 @@ SetLocalAuthorization (struct display *d) ; d-authNameNum = i; free (d-authNameLens); -d-authNameLens = (unsigned short *) malloc - (d-authNameNum * sizeof (unsigned short)); +d-authNameLens = malloc (d-authNameNum * sizeof (unsigned short)); if (!d-authNameLens) return; for (i = 0; i d-authNameNum; i++) d-authNameLens[i] = strlen (d-authNames[i]); -auths = (Xauth **) malloc (d-authNameNum * sizeof (Xauth *)); +auths = malloc (d-authNameNum * sizeof (Xauth *)); if (!auths) return; j = 0; @@ -675,7 +674,7 @@ saveEntry (Xauth *auth) { struct addrList *new; - new = (struct addrList *) malloc (sizeof (struct addrList)); + new = malloc (sizeof (struct addrList)); if (!new) { LogOutOfMem (saveEntry); return; diff --git a/xdm/choose.c b/xdm/choose.c index 05a58b8..6f077eb 100644 --- a/xdm/choose.c +++ b/xdm/choose.c @@ -127,7 +127,7 @@ RememberIndirectClient ( if (XdmcpARRAY8Equal (clientAddress, i-client) connectionType == i-connectionType) return 1; -i = (IndirectUsersPtr) malloc (sizeof (IndirectUsersRec)); +i = malloc (sizeof (IndirectUsersRec)); if (!XdmcpCopyARRAY8 (clientAddress, i-client)) { free (i); @@ -311,7 +311,7 @@ RegisterIndirectChoice ( insert = 0; if (!c) { - c = (ChoicePtr) malloc (sizeof (ChoiceRec)); + c = malloc (sizeof (ChoiceRec)); insert = 1; if (!c) return 0; diff --git a/xdm/dpylist.c b/xdm/dpylist.c index ad50e76..4418894 100644 --- a/xdm/dpylist.c +++ b/xdm/dpylist.c @@ -181,7 +181,7 @@ NewDisplay (char *name, char *class) { struct display *d; -d = (struct display *) calloc (1, sizeof (struct display)); +d = calloc (1, sizeof (struct display)); if (!d) { LogOutOfMem (NewDisplay); return NULL; diff --git a/xdm/file.c b/xdm/file.c index 9cb0922..6e929b8 100644 --- a/xdm/file.c +++ b/xdm/file.c @@ -76,14 +76,13 @@ splitIntoWords (char *s) ++s; if (!args) { - args = (char **) malloc (2 * sizeof (char *)); +
[PATCH:xdm 5/5] Only greeter needs XPM CFLAGS LIBS, not xdm daemon
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- configure.ac |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 38717d0..089329f 100644 --- a/configure.ac +++ b/configure.ac @@ -325,8 +325,6 @@ AC_ARG_ENABLE(xpm-logos, PKG_CHECK_EXISTS(xpm, [USE_XPM=yes], [USE_XPM=no])) if test x$USE_XPM = xyes ; then PKG_CHECK_MODULES(XPM, xpm) - XDM_CFLAGS=$XDM_CFLAGS $XPM_CFLAGS - XDM_LIBS=$XDM_LIBS $XPM_LIBS GREETER_CFLAGS=$GREETER_CFLAGS $XPM_CFLAGS GREETER_LIBS=$GREETER_LIBS $XPM_LIBS AC_DEFINE([XPM], 1, -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 1/5] Fix potential memory leak in allocation failure cleanup path
On Sat, May 14, 2011 at 11:01:29 -0700, Alan Coopersmith wrote: Error: Memory leak (CWE 401) Memory leak of pointer 'newargv' allocated with realloc(((i8*)argv), ((i * 4) + 8)) at line 239 of /export/alanc/X.Org/git/app/xdm/xdm/util.c in function 'parseArgs'. 'newargv' allocated at line 231 with realloc(((i8*)argv), ((i * 4) + 8)). newargv leaks when newargv != 0 at line 234 and save == 0 at line 234. [This bug was found by the Parfait 0.3.7 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- xdm/util.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) For the series, Reviewed-by: Julien Cristau jcris...@debian.org Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 7/9] doc: add external doc references support to Xserver-DTrace
On Sat, 14 May 2011 13:30:35 -0400, Gaetan Nadon mems...@videotron.ca wrote: A new doc was added in the Makefile which needs to be relocated. I reposted 7,8 and 9. Thanks! -- keith.pack...@intel.com pgpAe7aciJsXf.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] doc: use devbook.am for developers documentation
On Sat, 14 May 2011 13:30:20 -0400, Gaetan Nadon mems...@videotron.ca wrote: Relocate the docs under the doc subdir. Remove redundant xml subdir. The xmlrules set of makefiles are no longer used. Reviewed-by Jeremy Huddleston jerem...@apple.com Signed-off-by: Gaetan Nadon mems...@videotron.ca I've merged all three of these (thanks for fixing them). 221507e..0e7f61d master - master -- keith.pack...@intel.com pgpFWPcP6HT9I.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 3/5] Stop casting free() arguments to (char *)
From: Alan Coopersmith alan.coopersm...@oracle.com Date: Sat, 14 May 2011 11:01:31 -0700 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Heh, noticed the stupid casts in one of the other diffs in this series, and asked myself why you didn't remove them. So obviously I agree with this ;). Reviewed-by: Mark Kettenis kette...@openbsd.org chooser/chooser.c | 12 ++-- xdm/access.c | 18 +- xdm/auth.c| 14 +++--- xdm/choose.c | 12 ++-- xdm/dpylist.c |8 xdm/file.c|4 ++-- xdm/krb5auth.c|6 +++--- xdm/mitauth.c | 12 ++-- xdm/protodpy.c| 10 +- xdm/rpcauth.c |6 +++--- xdm/server.c |2 +- xdm/util.c|4 ++-- xdm/xdmauth.c | 18 +- xdm/xdmcp.c | 12 ++-- 14 files changed, 69 insertions(+), 69 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 4/5] Stop casting return values of malloc and friends
From: Alan Coopersmith alan.coopersm...@oracle.com Date: Sat, 14 May 2011 11:01:32 -0700 It's not needed on modern mallocs that return void *, and can hide missing prototype errors that cause the compiler to assume int is returned (a bad thing to assume in 64-bit builds). Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Mark Kettenis kette...@openbsd.org --- chooser/chooser.c |8 xdm/access.c |4 ++-- xdm/auth.c|7 +++ xdm/choose.c |4 ++-- xdm/dpylist.c |2 +- xdm/file.c|7 +++ xdm/krb5auth.c|7 +++ xdm/mitauth.c |6 +++--- xdm/policy.c |2 +- xdm/protodpy.c|4 ++-- xdm/resource.c|2 +- xdm/rpcauth.c |6 +++--- xdm/server.c |2 +- xdm/session.c |2 +- xdm/util.c|8 xdm/xdmauth.c |8 xdm/xdmcp.c |4 ++-- 17 files changed, 40 insertions(+), 43 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 2/5] Stop checking for NULL before calling free()
From: Alan Coopersmith alan.coopersm...@oracle.com Date: Sat, 14 May 2011 11:01:30 -0700 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Mark Kettenis kette...@openbsd.org --- chooser/chooser.c |3 +-- xdm/access.c | 15 +-- xdm/auth.c|9 +++-- xdm/dm.c |3 +-- xdm/dpylist.c | 50 -- xdm/krb5auth.c|3 +-- xdm/server.c |3 +-- xdm/socket.c |3 +-- xdm/util.c|3 +-- xdm/xdmauth.c |6 ++ xdm/xdmcp.c |4 ++-- 11 files changed, 42 insertions(+), 60 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] dix: Don't implicitly define verify_internal_event
Fixes regression introduced by 56901998020b6f443cbaa5eb303100d979e81b22 Also includes some other style cleanups. events.c:2198:24: warning: equality comparison with extraneous parentheses [-Wparentheses,Semantic Issue] else if ((type == MotionNotify)) ~^~~ events.c:2198:24: note: remove extraneous parentheses around the comparison to silence this warning [Semantic Issue] else if ((type == MotionNotify)) ~ ^ ~ events.c:2198:24: note: use '=' to turn this equality comparison into an assignment [Semantic Issue] else if ((type == MotionNotify)) ^~ = events.c:2487:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue] verify_internal_event(event); ^ events.c:5909:22: warning: declaration shadows a local variable [-Wshadow,Semantic Issue] DeviceIntPtr it = inputInfo.devices; ^ events.c:5893:18: note: previous declaration is here DeviceIntPtr it = inputInfo.devices; ^ 3 warnings and 1 error generated. events.c:2836:27: warning: incompatible pointer types passing 'DeviceEvent *' (aka 'struct _DeviceEvent *') to parameter of type 'const InternalEvent *' (aka 'const union _InternalEvent *') verify_internal_event(ev); ^~ ../include/inpututils.h:40:56: note: passing argument to parameter 'ev' here extern void verify_internal_event(const InternalEvent *ev); ^ 1 warning generated. Found-by: yuffie tinderbox (-Werror=implicit) Signed-off-by: Jeremy Huddleston jerem...@apple.com --- dix/events.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dix/events.c b/dix/events.c index 14f6f90..b60c299 100644 --- a/dix/events.c +++ b/dix/events.c @@ -112,6 +112,7 @@ Equipment Corporation. #include X11/Xproto.h #include windowstr.h #include inputstr.h +#include inpututils.h #include scrnintstr.h #include cursorstr.h @@ -2195,7 +2196,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent */ if (!grab ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask)) /* grab activated */; -else if ((type == MotionNotify)) +else if (type == MotionNotify) pDev-valuator-motionHintWindow = pWin; else if (type == DeviceMotionNotify || type == DeviceButtonPress) CheckDeviceGrabAndHintWindow (pWin, type, @@ -2832,7 +2833,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) WindowPtr prevSpriteWin, newSpriteWin; SpritePtr pSprite = pDev-spriteInfo-sprite; -verify_internal_event(ev); +verify_internal_event((InternalEvent *)ev); prevSpriteWin = pSprite-win; @@ -5906,7 +5907,7 @@ PickPointer(ClientPtr client) if (!client-clientPtr) { -DeviceIntPtr it = inputInfo.devices; +it = inputInfo.devices; while (it) { if (IsMaster(it) it-spriteInfo-spriteOwner) -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 5/5] Only greeter needs XPM CFLAGS LIBS, not xdm daemon
On Sat, 2011-05-14 at 11:01 -0700, Alan Coopersmith wrote: Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- configure.ac |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 38717d0..089329f 100644 --- a/configure.ac +++ b/configure.ac @@ -325,8 +325,6 @@ AC_ARG_ENABLE(xpm-logos, PKG_CHECK_EXISTS(xpm, [USE_XPM=yes], [USE_XPM=no])) if test x$USE_XPM = xyes ; then PKG_CHECK_MODULES(XPM, xpm) - XDM_CFLAGS=$XDM_CFLAGS $XPM_CFLAGS - XDM_LIBS=$XDM_LIBS $XPM_LIBS GREETER_CFLAGS=$GREETER_CFLAGS $XPM_CFLAGS GREETER_LIBS=$GREETER_LIBS $XPM_LIBS AC_DEFINE([XPM], 1, Acked-by: Gaetan Nadon mems...@videotron.ca signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] linux: Clean up filenames used in Linux VT init.
According to the comment in the Linux kernel source file drivers/tty/vt/vt_ioctl.c /dev/tty0 points to /dev/console, so we should just go to /dev/console, and virtual terminals are always labeled /dev/ttyN where N is 1..MAX_NR_CONSOLES, so only check /dev/ttyN. Signed-off-by: Cody Maloney cmalo...@theoreticalchaos.com --- hw/xfree86/os-support/linux/lnx_init.c | 39 ++- 1 files changed, 8 insertions(+), 31 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 77dfb2f..04518f3 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -76,17 +76,17 @@ switch_to(int vt, const char *from) void xf86OpenConsole(void) { -int i, fd = -1, ret; +int fd = -1, ret; struct vt_mode VT; struct vt_stat vts; MessageType from = X_PROBED; -char *tty0[] = { /dev/tty0, /dev/vc/0, NULL }; -char *vcs[] = { /dev/vc/%d, /dev/tty%d, NULL }; +const char *console_fname = /dev/console; +char *vcs = /dev/tty%d; if (serverGeneration == 1) { /* when KeepTty check if we're run with euid==0 */ - if (KeepTty geteuid() != 0) + if (KeepTty geteuid() != 0) FatalError(xf86OpenConsole: Server must be suid root for option \KeepTTY\\n); @@ -96,17 +96,11 @@ xf86OpenConsole(void) if (xf86Info.vtno != -1) { from = X_CMDLINE; } else { + fd = open(console_fname, O_WRONLY, 0); - i=0; - while (tty0[i] != NULL) { - if ((fd = open(tty0[i],O_WRONLY,0)) = 0) - break; - i++; - } - if (fd 0) FatalError( - xf86OpenConsole: Cannot open /dev/tty0 (%s)\n, + xf86OpenConsole: Cannot open /dev/console to use VT ioctls (%s)\n, strerror(errno)); if (ShareVTs) @@ -149,13 +143,8 @@ xf86OpenConsole(void) strerror(errno)); } -i=0; -while (vcs[i] != NULL) { -sprintf(vtname, vcs[i], xf86Info.vtno); /* /dev/tty1-64 */ - if ((xf86Info.consoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) = 0) - break; -i++; -} +sprintf(vtname, vcs, xf86Info.vtno); /* /dev/tty1-64 */ +xf86Info.consoleFd = open(vtname, O_RDWR|O_NDELAY, 0); if (xf86Info.consoleFd 0) FatalError(xf86OpenConsole: Cannot open virtual console @@ -172,18 +161,6 @@ xf86OpenConsole(void) else activeVT = vts.v_active; -#if 0 - if (!KeepTty) { - /* -* Detach from the controlling tty to avoid char loss -*/ - if ((i = open(/dev/tty,O_RDWR)) = 0) { - SYSCALL(ioctl(i, TIOCNOTTY, 0)); - close(i); - } - } -#endif - if (!ShareVTs) { struct termios nTty; -- 1.7.5.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xdm 5/5] Only greeter needs XPM CFLAGS LIBS, not xdm daemon
For all 5: Reviewed-by: Jeremy Huddleston jerem...@apple.com On May 14, 2011, at 11:01, Alan Coopersmith wrote: Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- configure.ac |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 38717d0..089329f 100644 --- a/configure.ac +++ b/configure.ac @@ -325,8 +325,6 @@ AC_ARG_ENABLE(xpm-logos, PKG_CHECK_EXISTS(xpm, [USE_XPM=yes], [USE_XPM=no])) if test x$USE_XPM = xyes ; then PKG_CHECK_MODULES(XPM, xpm) - XDM_CFLAGS=$XDM_CFLAGS $XPM_CFLAGS - XDM_LIBS=$XDM_LIBS $XPM_LIBS GREETER_CFLAGS=$GREETER_CFLAGS $XPM_CFLAGS GREETER_LIBS=$GREETER_LIBS $XPM_LIBS AC_DEFINE([XPM], 1, -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] linux: Clean up filenames used in Linux VT init.
On Sat, May 14, 2011 at 13:38:27 -0700, Cody Maloney wrote: According to the comment in the Linux kernel source file drivers/tty/vt/vt_ioctl.c /dev/tty0 points to /dev/console, so we should just go to /dev/console, and virtual terminals are always labeled /dev/ttyN where N is 1..MAX_NR_CONSOLES, so only check /dev/ttyN. Signed-off-by: Cody Maloney cmalo...@theoreticalchaos.com --- hw/xfree86/os-support/linux/lnx_init.c | 39 ++- 1 files changed, 8 insertions(+), 31 deletions(-) NAK. I think this breaks system with a serial console, where you can't always use VT ioctls on /dev/console. Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] linux: Clean up filenames used in Linux VT init.
I'm not an expert in this in any way, but looking at http://www.kernel.org/doc/Documentation/devices.txt it states under the terminal devices section, The console device, /dev/console, is the device to which system messages should be sent. Based on the sparse mailing list postings/documentation I could find I believe that /dev/vc/* is legacy from devfs, in udev only /dev/tty* is used. Cody On Sat, May 14, 2011 at 12:49 PM, Julien Cristau jcris...@debian.org wrote: On Sat, May 14, 2011 at 13:38:27 -0700, Cody Maloney wrote: According to the comment in the Linux kernel source file drivers/tty/vt/vt_ioctl.c /dev/tty0 points to /dev/console, so we should just go to /dev/console, and virtual terminals are always labeled /dev/ttyN where N is 1..MAX_NR_CONSOLES, so only check /dev/ttyN. Signed-off-by: Cody Maloney cmalo...@theoreticalchaos.com --- hw/xfree86/os-support/linux/lnx_init.c | 39 ++- 1 files changed, 8 insertions(+), 31 deletions(-) NAK. I think this breaks system with a serial console, where you can't always use VT ioctls on /dev/console. Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] linux: Clean up filenames used in Linux VT init.
After a little bit more searching I found conflicting information in http://www.kernel.org/doc/Documentation/serial-console.txt, which says /dev/tty0 should be used. I can switch the code to use /dev/tty0 instead of /dev/console since the documentation seems to uniformly say that should work, while it conflicts itself about /dev/console. Cody On Sat, May 14, 2011 at 2:09 PM, Cody Maloney cmalo...@theoreticalchaos.com wrote: I'm not an expert in this in any way, but looking at http://www.kernel.org/doc/Documentation/devices.txt it states under the terminal devices section, The console device, /dev/console, is the device to which system messages should be sent. Based on the sparse mailing list postings/documentation I could find I believe that /dev/vc/* is legacy from devfs, in udev only /dev/tty* is used. Cody On Sat, May 14, 2011 at 12:49 PM, Julien Cristau jcris...@debian.org wrote: On Sat, May 14, 2011 at 13:38:27 -0700, Cody Maloney wrote: According to the comment in the Linux kernel source file drivers/tty/vt/vt_ioctl.c /dev/tty0 points to /dev/console, so we should just go to /dev/console, and virtual terminals are always labeled /dev/ttyN where N is 1..MAX_NR_CONSOLES, so only check /dev/ttyN. Signed-off-by: Cody Maloney cmalo...@theoreticalchaos.com --- hw/xfree86/os-support/linux/lnx_init.c | 39 ++- 1 files changed, 8 insertions(+), 31 deletions(-) NAK. I think this breaks system with a serial console, where you can't always use VT ioctls on /dev/console. Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] linux: Clean up filenames used in Linux VT init.
According to the kernel documentation doc/Documentation/serial-console.txt and doc/Documentation/devices.txt we should use /dev/ttyN. /dev/tty0 for the VT ioctls, and /dev/ttyN for all the virtual terminals. Checking /dev/vc is therefore unnecessary. Signed-off-by: Cody Maloney cmalo...@theoreticalchaos.com --- hw/xfree86/os-support/linux/lnx_init.c | 39 ++- 1 files changed, 8 insertions(+), 31 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 77dfb2f..9ee93b2 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -76,12 +76,12 @@ switch_to(int vt, const char *from) void xf86OpenConsole(void) { -int i, fd = -1, ret; +int fd = -1, ret; struct vt_mode VT; struct vt_stat vts; MessageType from = X_PROBED; -char *tty0[] = { /dev/tty0, /dev/vc/0, NULL }; -char *vcs[] = { /dev/vc/%d, /dev/tty%d, NULL }; +const char *console_fname = /dev/tty0; +const char *tty = /dev/tty%d; if (serverGeneration == 1) { @@ -96,18 +96,12 @@ xf86OpenConsole(void) if (xf86Info.vtno != -1) { from = X_CMDLINE; } else { + fd = open(console_fname, O_WRONLY, 0); - i=0; - while (tty0[i] != NULL) { - if ((fd = open(tty0[i],O_WRONLY,0)) = 0) - break; - i++; - } - if (fd 0) FatalError( - xf86OpenConsole: Cannot open /dev/tty0 (%s)\n, - strerror(errno)); + xf86OpenConsole: Cannot open /dev/console to use VT + ioctls (%s)\n, strerror(errno)); if (ShareVTs) { @@ -149,13 +143,8 @@ xf86OpenConsole(void) strerror(errno)); } -i=0; -while (vcs[i] != NULL) { -sprintf(vtname, vcs[i], xf86Info.vtno); /* /dev/tty1-64 */ - if ((xf86Info.consoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) = 0) - break; -i++; -} +sprintf(vtname, tty, xf86Info.vtno); /* /dev/tty1-64 */ +xf86Info.consoleFd = open(vtname, O_RDWR|O_NDELAY, 0); if (xf86Info.consoleFd 0) FatalError(xf86OpenConsole: Cannot open virtual console @@ -172,18 +161,6 @@ xf86OpenConsole(void) else activeVT = vts.v_active; -#if 0 - if (!KeepTty) { - /* -* Detach from the controlling tty to avoid char loss -*/ - if ((i = open(/dev/tty,O_RDWR)) = 0) { - SYSCALL(ioctl(i, TIOCNOTTY, 0)); - close(i); - } - } -#endif - if (!ShareVTs) { struct termios nTty; -- 1.7.5.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH updated] input: Don't implicitly define verify_internal_event
I missed the one in mieq.c in the first patch. This should fully fix it now. --- From 2f6a3c12b2d344e6cb38c89423f1227453e9a0b4 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston jerem...@apple.com Date: Sat, 14 May 2011 12:23:44 -0700 Subject: [PATCH] input: Don't implicitly define verify_internal_event Fixes regression introduced by 56901998020b6f443cbaa5eb303100d979e81b22 mieq.c:159:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue] verify_internal_event(e); ^ 1 error generated. Also includes some other warning cleanups in events.c we're there. events.c:2198:24: warning: equality comparison with extraneous parentheses [-Wparentheses,Semantic Issue] else if ((type == MotionNotify)) ~^~~ events.c:2198:24: note: remove extraneous parentheses around the comparison to silence this warning [Semantic Issue] else if ((type == MotionNotify)) ~ ^ ~ events.c:2198:24: note: use '=' to turn this equality comparison into an assignment [Semantic Issue] else if ((type == MotionNotify)) ^~ = events.c:2487:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue] verify_internal_event(event); ^ events.c:5909:22: warning: declaration shadows a local variable [-Wshadow,Semantic Issue] DeviceIntPtr it = inputInfo.devices; ^ events.c:5893:18: note: previous declaration is here DeviceIntPtr it = inputInfo.devices; ^ 3 warnings and 1 error generated. events.c:2836:27: warning: incompatible pointer types passing 'DeviceEvent *' (aka 'struct _DeviceEvent *') to parameter of type 'const InternalEvent *' (aka 'const union _InternalEvent *') verify_internal_event(ev); ^~ ../include/inpututils.h:40:56: note: passing argument to parameter 'ev' here extern void verify_internal_event(const InternalEvent *ev); ^ 1 warning generated. Found-by: yuffie tinderbox (-Werror=implicit) Signed-off-by: Jeremy Huddleston jerem...@apple.com --- dix/events.c |7 --- mi/mieq.c|1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dix/events.c b/dix/events.c index 14f6f90..b60c299 100644 --- a/dix/events.c +++ b/dix/events.c @@ -112,6 +112,7 @@ Equipment Corporation. #include X11/Xproto.h #include windowstr.h #include inputstr.h +#include inpututils.h #include scrnintstr.h #include cursorstr.h @@ -2195,7 +2196,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent */ if (!grab ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask)) /* grab activated */; -else if ((type == MotionNotify)) +else if (type == MotionNotify) pDev-valuator-motionHintWindow = pWin; else if (type == DeviceMotionNotify || type == DeviceButtonPress) CheckDeviceGrabAndHintWindow (pWin, type, @@ -2832,7 +2833,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev) WindowPtr prevSpriteWin, newSpriteWin; SpritePtr pSprite = pDev-spriteInfo-sprite; -verify_internal_event(ev); +verify_internal_event((InternalEvent *)ev); prevSpriteWin = pSprite-win; @@ -5906,7 +5907,7 @@ PickPointer(ClientPtr client) if (!client-clientPtr) { -DeviceIntPtr it = inputInfo.devices; +it = inputInfo.devices; while (it) { if (IsMaster(it) it-spriteInfo-spriteOwner) diff --git a/mi/mieq.c b/mi/mieq.c index 031b11a..fc3738a 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group. # include windowstr.h # include pixmapstr.h # include inputstr.h +# include inpututils.h # include mi.h # include mipointer.h # include scrnintstr.h -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] input: Fix format string for verify_internal_event
inpututils.c:577:25: warning: conversion specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat,Format String Issue] ErrorF(%02hx , *data); ^~ %02hhx 1 warning generated. Signed-off-by: Jeremy Huddleston jerem...@apple.com --- dix/inpututils.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dix/inpututils.c b/dix/inpututils.c index aeace6e..49e1758 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -574,7 +574,7 @@ void verify_internal_event(const InternalEvent *ev) for (i = 0; i sizeof(xEvent); i++, data++) { -ErrorF(%02hx , *data); +ErrorF(%02hhx , *data); if ((i % 8) == 7) ErrorF(\n); -- 1.7.4.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: IR remote control autorepeat / evdev
Em 14-05-2011 01:07, Anssi Hannula escreveu: On 14.05.2011 01:39, Mauro Carvalho Chehab wrote: Em 13-05-2011 01:48, Anssi Hannula escreveu: On 12.05.2011 04:36, Mauro Carvalho Chehab wrote: Em 12-05-2011 03:10, Mauro Carvalho Chehab escreveu: Em 12-05-2011 02:37, Anssi Hannula escreveu: I don't see any other places: $ git grep 'REP_PERIOD' . dvb/dvb-usb/dvb-usb-remote.c: input_dev-rep[REP_PERIOD] = d-props.rc.legacy.rc_interval; Indeed, the REP_PERIOD is not adjusted on other drivers. I agree that we should change it to something like 125ms, for example, as 33ms is too short, as it takes up to 114ms for a repeat event to arrive. IMO, the enclosed patch should do a better job with repeat events, without needing to change rc-core/input/event logic. It will indeed reduce the amount of ghost events so it brings us in the right direction. I'd still like to get rid of the ghost repeats entirely, or at least some way for users to do it if we don't do it by default. Maybe we could replace the kernel softrepeat with native repeats (for those protocols/drivers that have them), while making sure that repeat events before REP_DELAY are ignored and repeat events less than REP_PERIOD since the previous event are ignored, so the users can still configure them as they like? This doesn't seem to be the right thing to do. If the kernel will accept 33 ms as the value or REP_PERIOD, but it will internally set the maximum repeat rate is 115 ms (no matter what logic it would use for that), Kernel (or X) shouldn't allow the user to set a smaller value. The thing is that writing a logic to block a small value is not easy, since the max value is protocol-dependent (worse than that, on some cases, it is device-specific). It seems better to add a warning at the userspace tools that delays lower than 115 ms can produce ghost events on IR's. From what I see, even periods longer than 115 ms can produce ghost events. For example with your patch softrepeat period is 125ms, release timeout 250ms, and a native rate of 110ms: There are 4 native events transmitted at 000 ms 110 ms 220 ms 330 ms (user stops between 330ms and 440ms) This causes these events in the evdev interface: 000: 1 125: 2 250: 2 375: 2 500: 2 550: 0 So we got 1-2 ghost repeat events. Or maybe just a module option that causes rc-core to use native repeat events, for those of us that want accurate repeat events without ghosting? If the user already knows about the possibility to generate ghost effects, with low delays, he can simply not pass a bad value to the kernel, instead of forcing a modprobe parameter that will limit the minimal value. There is no good value for REP_PERIOD (as in ghost repeats guaranteed gone like with native repeats). Sufficiently large values will make ghost repeats increasingly rare, but the period becomes so long the autorepeat becomes frustratingly slow to use. The 250 ms delay used internally to wait for a repeat code is there because shorter periods weren't working on one of the first boards we've added to rc core (it was a saa7134 - can't remember much details... too much time ago). I remember that I added it as a per-board timer (or per protocol?), as it seemed to high for me, but later, David sent a series of patches rewriting the entire stuff and proposing to have just one timer, arguing that later this could be changed. As his series were improving rc-core, I ended by acking with the changes. The fact is that REP_PERIODS shorter than that timer makes non-sense, as that timer is used to actually wait for a repeat message. I suspect we should re-work the code, perhaps replacing the 250 ms fixed value by REP_PERIOD. I can't work on it this weekend, as I'm about to leave Hungary to return back home. I suspect that I'll have lots of fun next week, due to a one-week travel, and due to the .40 merge window (I suspect it will be opened next week). Maybe Jarod can find some time to do such patch and test it. Thanks, Mauro. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel