Re: Failed non-blocking connect returns incorrect errno on AF_UNIXprotocol

2003-03-26 Thread David Huang
Corinna Vinschen wrote:
On Wed, Mar 26, 2003 at 08:48:33AM +0800, David Huang wrote:

Failed non-blocking connect returns incorrect errno on AF_UNIX protocol.
See attached test program.
On cygwin:
$ ./afunix
EINPROGRESS: Operation now in progress
On
Linux 2.4 (Debian 2.2)
Linux 2.4 (Redhat 7.3)
Sun Solaris (8):
$ ./afunix
ECONNREFUSED: Connection refused
When i comment following code:
//  if (fcntl (fd2, F_SETFL, O_NONBLOCK)  0)
//  printf (Failed to set fd non-blocking);
The result is
ECONNREFUSED: Connection refused
It seems an old bug.
I don't know whether it effect others address/protocol families.


I don't see that it's an error.  On non-blocking sockets you have to
expect that connect() returns before being connected.  Just because
other systems are so quick figuring out that nothing is listening on
the other side, this doesn't invalidate the EINPROGRESS response under,
well, slower conditions.
Well, in my test-case, /tmp/.afunix is a dead socket, connect must return
ECONNREFUSED but not EINPROGRESS, is it so?
And, btw., SUSv3 doesn't say a word that EINPROGRESS is not a valid
response for AF_LOCAL sockets.
Yea, is it a valid response for *alive* AF_LOCAL sockets?

Please consider that, the test code i took from linc-1.0.1 (cleanup.c), because of
that, linc-cleanup-sockets works incorrect.
Corinna

Thanks.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Failed non-blocking connect returns incorrect errno on AF_UNIXprotocol

2003-03-26 Thread David Huang
Steven O'Brien wrote:
On Wed, Mar 26, 2003 at 08:48:33AM +0800, David Huang wrote:

Failed non-blocking connect returns incorrect errno on AF_UNIX
protocol.


I think it is unlikely that the app really needs the connect() call to
be non-blocking (otherwise it would have to handle the in-progress
Well, bingo, linc(cleanup.c) use code like this.
case). So a simple solution in most cases is to do the connect() first,
then the fcntl(fd, F_SETFL, O_NONBLOCK) so that data transfer is
non-blocking.
Aha! Follow your hints, i modify the code, looks like linc-cleanup-sockets works
a bit correct. And I remove fcntl(fd, F_SETFL, O_NONBLOCK) code, get the same result.
But, what's the different between these?
Regards,
Steven
Thanks.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Mozilla 1.3 built on cygwin?

2003-03-26 Thread David Huang
Christopher Faylor wrote:
On Wed, Mar 26, 2003 at 09:59:19PM -0800, Randall R Schulz wrote:

  2. Having a complex GUI app like Mozilla ported to Cygwin could
  prove to be a stick in which to measure and compare the over
  all efficiency and performance of Cygwin. If the native
  Mozilla and the Cygwin version performed reasonably the same,
  then we would know that Cygwin is on track. If the Cygwin
  version lagged, it would set concrete goals for the
  Cygwin/XFree team.
That's not going to happen any time soon. XFree86/Cygwin has no 
graphics acceleration. Apart from that, little if anything runs as fast 
through Cygwin as it does on the Win32 API even if GUI operation is 
ignored or irrelevant.

I don't mean this as a criticism, but just a fact. I imagine the 
biggest win would be by getting some graphics acceleration in XFree86.


Yeah, this was my first thought when I saw this thread.
Not exactly. If so, we can try another X server.

However, getting mozilla run on cygwin is a challenge.:-)

$app = mozilla;
print Why is $app so *slow* on cygwin!; 
I believe that.
cgf

--


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: motif libs

2003-03-04 Thread David Huang
Darbin Rowland-p95674 wrote:
I have the rpm files for i386 motif but I can't install them because I don't have rpm.
 
How do you isntall rpms on cygwin? 
 
Thanks, 
Rowland
 
Hi,
Please google rpm cygwin first.
here: http://sourceforge.net/projects/cygwin-rpm/
Unfortunately, it had discontinued. You can download old binary package 
rpm-3.0.6.tar.gz.
Note: If you have installed popt, please remove the conflict files in rpm-3.0.6.tar.gz.
BTW: Are these i386 motif rpm files for cygwin?



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Running GIMP under Cygwin (not Win32!)??

2003-03-03 Thread David Huang
Oops! sorry, i forget the patches:(

Good luck;)

Chris Olive wrote:
I posted this question to the cygwin mailing list last week, and someone on that list referred me here and said he cross-posted for me.  I didn't hear anything from his cross-post, so I'm trying again...

It would seem it's at least possible to run The GIMP under Cygwin/XFree.  Try as I might, I can't get it to work.  Specifically, I can't get some of the necessary pre-requeistes to configure and make properly (glib, GTK+, etc.)  Has ANYONE gotten GIMP to work under Cygwin, and if so, specifically what steps did you take to get it to work?  I've done a lot of research on this before asking the question, and there is bare mention of this on the web -- I see NO WHERE where anyone claims that this works.  Essentially, there is no SOLID information ANYWHERE on getting this to work.

I am interested only in running GIMP under Cygwin/XFree -- I am NOT interested the Win32 version of GIMP!  Any help would be GREATLY appreciated.

Thanks,
Chris
-
Chris Olive
chris[at]technologEase[dot]com
Hi!
I have compiled GIMP on cygwin successfully, using X-Window system, and it works fine.
Of cource, it's easy to get, since native Win32 port works fine.
If you like, please try my little patch, hope helpful.
First you need glib, gtk+, you can build them yourself from sources with patches from
http://homepage.ntlworld.com/steven.obrien2/ (contributed and maintained by Steven 
O'Brian).
Or, download glib, gtk+ binary packages directly from the Cygwin GNOME project
( http://sourceforge.net/projects/cygnome ), you can find more interesting GNOME
binary packages in cygnome-libs-1.4 (include glib, gtk+).
The build steps i have wrote into a file cygbuild.sh, like:

$ ./configure --prefix=/opt/gnome --enable-shared=yes --enable-static=no --disable-perl
Please disable perl plugin, with little patched you can compile successfully, but 
running
GIMP hangs when try to load perl plugin script, in my test.
$ mv libtool libtool.old
$ cp /usr/autotool/devel/bin/libtool .
Update libtool to build DLL libs, i use the latest libtool.
$ make
$ make install
if you are luck, you'll get gimp run.
I have to say in my test it's OK, but i can't say it's really OK.
BTW: Please patch lib/glib/include/glibconfig.h,


diff -urN gimp-1.2.3-orig/app/Makefile.in gimp-1.2.3/app/Makefile.in
--- gimp-1.2.3-orig/app/Makefile.in 2002-02-12 05:46:18.0 +0800
+++ gimp-1.2.3/app/Makefile.in  2003-02-27 16:21:52.0 +0800
@@ -394,6 +394,7 @@
 
 clean-binPROGRAMS:
-test -z $(bin_PROGRAMS) || rm -f $(bin_PROGRAMS)
+   @rm -f gimp.def gimp.base gimp.exp libgimpapp.a
 
 distclean-binPROGRAMS:
 
@@ -416,8 +417,28 @@
done
 
 gimp-1.2: $(gimp_1_2_OBJECTS) $(gimp_1_2_DEPENDENCIES)
-   @rm -f gimp-1.2
-   $(LINK) $(gimp_1_2_LDFLAGS) $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+   @rm -f gimp-1.2$(EXEEXT)
+   @rm -f gimp.def gimp.base gimp.exp libgimpapp.a
+# cygwin build
+   $(LINK) -shared $(gimp_1_2_LDFLAGS) -Wl,--out-implib=libgimpapp.a 
-Wl,--export-all-symbols $(gimp_1_2_OBJECTS) -Wl,--no-whole-archive $(gimp_1_2_LDADD) 
$(LIBS)
+   $(DLLTOOL) --output-def gimp.def --dllname gimp-1.2$(EXEEXT) 
--export-all-symbols $(gimp_1_2_OBJECTS)
+   @rm -f gimp-1.2$(EXEEXT)
+   $(LINK) $(gimp_1_2_LDFLAGS) -Wl,--base-file,gimp.base $(gimp_1_2_OBJECTS) 
$(gimp_1_2_LDADD) $(LIBS)
+   $(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
+   $(LINK) $(gimp_1_2_LDFLAGS) -Wl,gimp.exp $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) 
$(LIBS)
+   cp libgimpapp.a .libs/libgimpapp.a
+# or
+#  echo EXPORTS gimp.def
+#  cat gimp.sym gimp.def
+#  $(LINK) $(gimp_1_2_LDFLAGS) -Wl,--base-file,gimp.base $(gimp_1_2_OBJECTS) 
$(gimp_1_2_LDADD) $(LIBS)
+#  $(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
+#  $(LINK) $(gimp_1_2_LDFLAGS) -Wl,--base-file,gimp.base,gimp.exp 
$(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
+#  $(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
+#  $(LINK) $(gimp_1_2_LDFLAGS) -Wl,gimp.exp $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) 
$(LIBS)
+#  $(DLLTOOL) --dllname gimp-1.2$(EXEEXT) --def gimp.def --output-lib 
libgimpapp.a $(gimp_OBJECTS)
+# orig
+#  @rm -f gimp-1.2
+#  $(LINK) $(gimp_1_2_LDFLAGS) $(gimp_1_2_OBJECTS) $(gimp_1_2_LDADD) $(LIBS)
 
 tags: TAGS
 
diff -urN gimp-1.2.3-orig/app/plug_in.c gimp-1.2.3/app/plug_in.c
--- gimp-1.2.3-orig/app/plug_in.c   2001-01-16 05:44:02.0 +0800
+++ gimp-1.2.3/app/plug_in.c2002-11-28 18:20:04.0 +0800
@@ -57,6 +57,7 @@
 #define _O_TEXT0x0100  /* text file */
 #define O_BINARY   0x0200  /* binary file */
 #define _O_BINARY  0x0200  /* binary file */
+#define xspawnv spawnv
 #endif
 
 #endif
diff -urN gimp-1.2.3-orig/cygbuild.sh gimp-1.2.3/cygbuild.sh
--- gimp-1.2.3-orig/cygbuild.sh 1970-01-01 08:00:00.0 +0800
+++ gimp-1.2.3/cygbuild.sh  

Re: Running GIMP under Cygwin (not Win32!)??

2003-03-03 Thread David Huang
Hi!
I'v uploaded the binary package and patches to 
sf.net(http://sourceforge.net/projects/cygnome).
You can download it from
http://sourceforge.net/project/showfiles.php?group_id=67909release_id=143989
Have fun!

David Huang wrote:
Oops! sorry, i forget the patches:(

Good luck;)

Chris Olive wrote:

I posted this question to the cygwin mailing list last week, and 
someone on that list referred me here and said he cross-posted for 
me.  I didn't hear anything from his cross-post, so I'm trying 
again...

It would seem it's at least possible to run The GIMP under 
Cygwin/XFree.  Try as I might, I can't get it to work.  Specifically, 
I can't get some of the necessary pre-requeistes to configure and 
make properly (glib, GTK+, etc.)  Has ANYONE gotten GIMP to work 
under Cygwin, and if so, specifically what steps did you take to get 
it to work?  I've done a lot of research on this before asking the 
question, and there is bare mention of this on the web -- I see NO 
WHERE where anyone claims that this works.  Essentially, there is no 
SOLID information ANYWHERE on getting this to work.

I am interested only in running GIMP under Cygwin/XFree -- I am NOT 
interested the Win32 version of GIMP!  Any help would be GREATLY 
appreciated.

Thanks,
Chris
-
Chris Olive
chris[at]technologEase[dot]com
Hi!
I have compiled GIMP on cygwin successfully, using X-Window system, 
and it works fine.
Of cource, it's easy to get, since native Win32 port works fine.
If you like, please try my little patch, hope helpful.
First you need glib, gtk+, you can build them yourself from sources 
with patches from
http://homepage.ntlworld.com/steven.obrien2/ (contributed and 
maintained by Steven O'Brian).
Or, download glib, gtk+ binary packages directly from the Cygwin GNOME 
project
( http://sourceforge.net/projects/cygnome ), you can find more 
interesting GNOME
binary packages in cygnome-libs-1.4 (include glib, gtk+).

The build steps i have wrote into a file cygbuild.sh, like:

$ ./configure --prefix=/opt/gnome --enable-shared=yes 
--enable-static=no --disable-perl
Please disable perl plugin, with little patched you can compile 
successfully, but running
GIMP hangs when try to load perl plugin script, in my test.

$ mv libtool libtool.old
$ cp /usr/autotool/devel/bin/libtool .
Update libtool to build DLL libs, i use the latest libtool.
$ make
$ make install
if you are luck, you'll get gimp run.
I have to say in my test it's OK, but i can't say it's really OK.
BTW: Please patch lib/glib/include/glibconfig.h,






Re: Debug build of X doesn't seem to load XF86Config

2003-02-27 Thread David Huang
Alexander Skwar wrote:
Hi.

As described in the first posting of Cannot recompile X, I also
compiled a debug build of X.  For this, I ran ./config/util/makeg.sh
World.
When I now run startx to start the debug build of X, it seems to
ignore my /etc/X11/XF86Config-4.  I think so, because if it would load
/etc/X11/XF86Config-4, it would read the FontPath entries I specified
there.  Now, both with and without XF86Config, I get the same number of
fonts (xlsfonts | wc -l).  In the build provided by cygwin, there's a
difference if XF86Config-4 is present.
I also tried renaming the file to /etc/X11/XF86Config.

Did I miss something when compiling X?
What's the version number of the xc source are you use?
Perhaps you need update the xc/programs/Xserver/hw/xwin sources from
 http://xfree86.cygwin.com/devel/shadow/
or try xc CVS snapshots?
Thanks,

Alexander Skwar




RE: Lesstif update II

2003-02-27 Thread David Huang
On Thu, 27 Feb 2003 00:42:18 -0500, Harold L Hunt II wrote:
Brian,

Thanks for the packages.  I am posting them now.  That is great that you
caught that bug.
Harold
Hi! Thanks for the update.
But has this problem too:
http://sources.redhat.com/ml/cygwin-xfree/2003-02/msg00029.html
Please fix.

Thanks.



Re: failed to make ddd-3.3.1

2003-02-23 Thread David Huang
On Wed, 19 Feb 2003 11:07:23 -0500, Kirschner, Paul E. UTRC wrote:
Previous posts claimed ddd built out of the box. My attempt (configure;
make) failed...
Making all in ddd
make[1]: Entering directory `/home/kirschpe/ddd-3.3.1/ddd'
c++ -DHAVE_CONFIG_H -I. -I. -I. -I./.. -isystem /usr/X11R6/include
-DNDEBUG -O2 -g -W -Wall -trigraphs  -c strclass.C
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
 from strclass.h:412,
 from strclass.C:41:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning
This file includes at least one deprecated or antiquated header. Please
consider using one of the 32 headers found in section 17.4.1.2 of the C++
standard. Examples include substituting the X header for the X.h header
for C++ includes, or sstream instead of the deprecated header
strstream.h. To disable this warning use -Wno-deprecated.
In file included from strclass.C:41:
strclass.h: In member function `string
string::operator=(std::ostrstream)':
strclass.h:1059: warning: unused variable `const int frozen'
strclass.C: In function `std::istream operator(std::istream, string)':
strclass.C:1443: invalid conversion from `int' to `std::_Ios_Iostate'
strclass.C:1443:   initializing argument 1 of `void std::basic_ios_CharT, 
   _Traits::clear(std::_Ios_Iostate) [with _CharT = char, _Traits = 
   std::char_traitschar]'
make[1]: *** [strclass.o] Error 1
make[1]: Leaving directory `/home/kirschpe/ddd-3.3.1/ddd'
make: *** [all-recursive] Error 1


Hi!
Please try gcc-2, g++-2.
I have compiled it successfully, but it dosn't work correctly.
There are some problems when ddd interacts with gdb.
I don't know what's the reason...
Any help? thanks...


-
Paul Kirschner
Systems Department
United Technologies Research Center
[EMAIL PROTECTED]
(860)610-7119



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: FW: file manager xfm, or similar for xfree86 under cygwin

2003-02-11 Thread David Huang
Cary Lewis write:

Hello, I am trying to locate a graphical file manager for Xfree86 running
under cygwin

 

I have tried to compile xfm 1.4.3 and got it working under xfree86 under
cygwin, but it does not allow access to non cygwin directories.

 

It complains saying Directory is Unreadable.

 

/cygdrive doesn't show up in the root, so I created a symlink with:
Why not create a dir /cygdrive? ls /cygdrive will show all c, d, e... drivers.
And I create a dir /dev, link cdrom to scd0, then use /dev/cdrom I have raw access
to the first CD-ROM.


 

ln -s /cygdrive/c /cygdrivec

 

I'm guessing it has trouble following a symlink from /cydrivec to
/cygdrive/c/

 

Can anyone suggest a working file manager?
I use xfce.


 

Thanks.

 

If anyone wants the Imake.options I can post or email.

 

Does anyone know where I can find a compiled binary for xfm or a similar
client.

 

I don't want to have to install the kde files or xfce.

 

My plan is to use cygwin / xfree86 via ssh to do remote support of windows
machines.

 

Thanks for any help.

 











dlfcn.cc: clear previous dl errors before new dlopen, dlsym, dlclosecall?

2003-01-21 Thread David Huang
Hi!
Is't needed to clear previous dl errors before new dlopen, dlsym, dlclose call?
See attach test programs.

$ gcc -shared -o demo.dll demo.c
$ gcc -shared -o demo2.dll demo2.c
$ gcc -o test test.c
$ ./test
Output:
handle = f2
dlsym init_plugin fail
init_plugin = 0
handle2 = f2
dlsym init_plugin fail
init_plugin = f21050

I think output maybe like these:
handle = f2
dlsym init_plugin fail
init_plugin = 0
handle2 = f2
init_plugin = f21050

Is it so?

Thanks.

2003-01-21  David Huang  [EMAIL PROTECTED]

	* dlfcn.cc: Add clear_dl_error.
	(dlopen): Clear previous dl error.
	(dlsym): Ditto.
	(dlclose): Ditto.





Index: dlfcn.cc
===
RCS file: /cvs/src/src/winsup/cygwin/dlfcn.cc,v
retrieving revision 1.17
diff -u -p -r1.17 dlfcn.cc
--- dlfcn.cc31 Oct 2001 00:55:32 -  1.17
+++ dlfcn.cc21 Jan 2003 09:08:39 -
@@ -1,6 +1,6 @@
 /* dlfcn.cc
 
-   Copyright 1998, 2000, 2001 Red Hat, Inc.
+   Copyright 1998, 2000, 2001, 2003 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -32,6 +32,12 @@ set_dl_error (const char *str)
   _dl_error = 1;
 }
 
+static void __stdcall
+clear_dl_error ()
+{
+  _dl_error = 0;
+}
+
 /* Look for an executable file given the name and the environment
variable to use for searching (eg., PATH); returns the full
pathname (static buffer) if found or NULL if not. */
@@ -89,6 +95,8 @@ dlopen (const char *name, int)
 
   void *ret;
 
+  clear_dl_error();
+
   if (name == NULL)
 ret = (void *) GetModuleHandle (NULL); /* handle for the current module */
   else
@@ -117,6 +125,8 @@ dlopen (const char *name, int)
 void *
 dlsym (void *handle, const char *name)
 {
+  clear_dl_error();
+
   void *ret = (void *) GetProcAddress ((HMODULE) handle, name);
   if (!ret)
 set_dl_error (dlsym);
@@ -128,6 +138,8 @@ int
 dlclose (void *handle)
 {
   SetResourceLock (LOCK_DLL_LIST, READ_LOCK | WRITE_LOCK, dlclose);
+
+  clear_dl_error();
 
   int ret = -1;
   void *temphandle = (void *) GetModuleHandle (NULL);


#include stdio.h
#include dlfcn.h

void main()
{
char plugin_name[256] = demo.dll;
char plugin_name2[256] = demo2.dll;
void *handle, *handle2;
void *(*init_plugin)();
char *error;

handle = dlopen(plugin_name, RTLD_NOW);
if (!handle) {
printf(dlopen fail\n);
//  return;
} 
printf(handle = %x\n, handle);
init_plugin = dlsym(handle, init_plugin);
if ((error = dlerror()) != NULL) {
printf(dlsym init_plugin fail\n);
//  dlclose(handle);
//  return;
}
printf(init_plugin = %x\n, init_plugin);
dlclose(handle);

handle2 = dlopen(plugin_name2, RTLD_NOW);
if (!handle2) {
printf(dlopen fail\n);
//  return;
}
printf(handle2 = %x\n, handle2);
init_plugin = dlsym(handle2, init_plugin);
if ((error = dlerror()) != NULL) {
printf(dlsym init_plugin fail\n);
//  dlclose(handle);
//  return;
}
printf(init_plugin = %x\n, init_plugin);

dlclose(handle2);
}



void no_init_plugin()
{}


void init_plugin()
{}