On 13/07/2012 22:36, Keith Packard wrote: > Popen and Pclose are never used on Windows, so don't bother to even > try to define them. > > System(s) was defined as system(s), but the two users of that > function are in xkb, which carefully redefines that as > Win32System. Move Win32System and Win32TempDir to os/utils.c, renaming > Win32System to be just System, which simplifies the xkb code > > Signed-off-by: Keith Packard <[email protected]> > Cc: Jon TURNEY <[email protected]>
Thanks for tidying this up. This seems to be correct, so: Reviewed-by: Jon TURNEY <[email protected]> > --- > include/os.h | 10 +++++--- > os/utils.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > xkb/ddxList.c | 6 ----- > xkb/ddxLoad.c | 75 > --------------------------------------------------------- > 4 files changed, 80 insertions(+), 84 deletions(-) > + > +const char * > +Win32TempDir() > +{ > + static char buffer[PATH_MAX]; > + > + if (GetTempPath(sizeof(buffer), buffer)) { > + int len; > + > + buffer[sizeof(buffer) - 1] = 0; > + len = strlen(buffer); > + if (len > 0) > + if (buffer[len - 1] == '\\') > + buffer[len - 1] = 0; > + return buffer; > + } > + if (getenv("TEMP") != NULL) > + return getenv("TEMP"); > + else if (getenv("TMP") != NULL) > + return getenv("TEMP"); > + else > + return "/tmp"; > +} I just notice in passing that this has been wrong since forever, the second getenv should be getenv("TMP"). I shall do a separate patch to fix that... _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
