Sender: bkorb AT sco DOT COM Message-ID: <397EEC40.9177C526@sco.com> Date: Wed, 26 Jul 2000 06:48:48 -0700 From: Bruce Korb Organization: Santa Cruz Operations X-Mailer: Mozilla 4.7 [en] (X11; I; SCO_SV 3.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: Eli Zaretskii CC: djgpp-workers AT delorie DOT com Subject: Re: DJGPP patch for fixincludes References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii wrote: > Were these diffs generated against the current CVS, or to the last > released version (or something else)? CVS, but I'll be applying the first patch today or tomorrow. > > All fix tests that depend on using a server shell are presumed > > to NOT APPLY in DOS-land. All fixes that use a shell script > > to produce the modification (all of one example anyway) are > > also presumed to NOT APPLY. > > Hmm... I'm afraid I don't know enough about this to comment off the > top of my head. DJGPP does have a working port of Bash, and our > system(3) knows how to run a script if Bash is installed, so if the > fixes performed by a shell script are useful, we could retain them. "if Bash is installed". I assure you they are not relevant to DOS anyway: /* * sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by * defining regex.h related types. This causes libg++ build and usage * failures. Fixing this correctly requires checking and modifying 3 files. */ fix = { hackname = osf_namespace_a; files = reg_types.h; files = sys/lc_core.h; test = " -r reg_types.h"; test = " -r sys/lc_core.h"; test = " -n \"`grep '} regex_t;' reg_types.h`\""; test = " -z \"`grep __regex_t regex.h`\""; ... fix = { hackname = uw7_byteorder_fix; files = arpa/inet.h; select = "in_port_t"; test = "-f $DESTDIR/sys/byteorder.h"; ... fix = { hackname = vxworks_needs_vxworks; files = sys/stat.h; test = " -r types/vxTypesOld.h"; test = " -n \"`egrep '#include' $file`\""; test = " -n \"`egrep ULONG $file`\""; select = "#[ \t]define[ \t]+__INCstath"; ... fix = { hackname = vxworks_time; files = time.h; test = " -r vxWorks.h"; ... > I have a few comments, based on code inspection; hopefully, they will > be useful to whoever works on this (or to myself ;-). > > > + pz_tmptmp = (char*)xmalloc( strlen( argv[4] ) + 5 ); > > + sprintf( pz_tmptmp, "%sX", argv[4] ); > > + if (freopen( pz_tmptmp, "w", stdout ) != stdin) > ^^^^^ > Shouldn't this be stdout? :-) > > + # ifdef __DOS__ > > + { > > + tSCC z_tmp_fname_fmt[] = "%s/fxinc%03X.tp"; > > + char* pz = getenv( "TMP" ); > > + if (pz == NULL) > > + pz = "/tmp"; > > + pz_temp_file = (char*)xmalloc (sizeof(z_tmp_fname_fmt) + strlen (pz)); > > + sprintf (pz_temp_file, z_tmp_fname_fmt, pz, getpid() & 0x0FFF); > > + } > > + # endif > > This should probably use $TMPDIR or tempnam(). Yes. This: > > + # ifdef __DOS__ > > + pz_temp_file = tempnam( "/tmp","fxinc"); > > + # endif is much simpler. > > ! #else > > ! /* > > ! * IF we are in MS-DOS land, then whatever shell-type test is required > > ! * will, by definition, fail > > ! */ > > ! #define test_test(t,tf) SKIP_FIX > > ! #endif > > See my comment above: if Bash is installed (and it must be, in order > to build GCC), these shell tests need not fail. > > Thanks again. Well, all of the existing tests are irrelevant, but if you want a proper fix, then, yes, run popen() and read back the true or false result.